Enable column ellipsis based on table width

Enable column ellipsis based on table width

birobiro 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

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    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 just data. To ensure that logic is applied to all columns, you would change targets on line 3 to be _all.

    Cheers,

    Colin

This discussion has been closed.