Enable column ellipsis based on table width
Enable column ellipsis based on table width
biro
Posts: 12Questions: 7Answers: 0
Is there a way to enable/disable the ellipsis on columns, based on table width?
if my table (or the viewport) is less than 900px (for example) it will turns on ellipsis otherwise, it will render the whole field as it is.
Thank you
This discussion has been closed.
Answers
Hi @biro ,
Not as such, but it wouldn't be too hard to implement. First off, this blog post here shows how to implement ellipses. Instead of just returning as on line 5 of that first example, you could test for the width of the table, and if below that threshold, you would return
substr
, otherwise justdata
. To ensure that logic is applied to all columns, you would changetargets
on line 3 to be_all
.Cheers,
Colin