quasar
quasar copied to clipboard
Truncate word in q-table
Hi,
I met a problem truncating word a q-table.
The original data is like this:

And I add attributes :
<q-td
:props="props"
:style="{width: '500px', whiteSpace: 'pre-wrap'}"
auto-width
class="ellipsis"
>
It then looks like:

But what I want is like this:

I would like to truncate the word in the table cell. Are there any solutions? Thank you!
Please use the discord channel or the forum for help requests. Thank you.
@arthur55 Hi, I just get the same issue, and i use the custom css to achieve this.
<q-td key="link" :props="props">
<div class="row justify-center">
<div style="width:200px" class="customEllipsis">{{ props.row.link }}</div>
</div>
</q-tb>
.customEllipsis {
text-overflow: ellipsis !important;
white-space: nowrap !important;
overflow: hidden !important;
}
hope this can help you
Hi, @arthur55 How did you solve this?
thanks @arthur55 https://quasar.dev/vue-components/table#example--body-cell-name-slot