quasar icon indicating copy to clipboard operation
quasar copied to clipboard

Truncate word in q-table

Open arthur55 opened this issue 6 years ago • 4 comments

Hi,

I met a problem truncating word a q-table.
The original data is like this:
image

And I add attributes :

<q-td
  :props="props"
  :style="{width: '500px', whiteSpace: 'pre-wrap'}"
  auto-width
  class="ellipsis"
>

It then looks like: image

But what I want is like this: image

I would like to truncate the word in the table cell. Are there any solutions? Thank you!

arthur55 avatar Apr 30 '20 09:04 arthur55

Please use the discord channel or the forum for help requests. Thank you.

pdanpdan avatar Apr 30 '20 09:04 pdanpdan

@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

Kanglinwu avatar Jan 02 '22 17:01 Kanglinwu

Hi, @arthur55 How did you solve this?

ilmcraft avatar Aug 01 '22 10:08 ilmcraft

thanks @arthur55 https://quasar.dev/vue-components/table#example--body-cell-name-slot

allan98 avatar Aug 26 '22 07:08 allan98