Max column width for text

Max column width for text

RemiDGRemiDG Posts: 15Questions: 0Answers: 0
edited March 2013 in General
I'm curious if it's possible to set a maximum column width (For example, 60px), and if the text in it gets any longer, cut the text off. We kinda need this, as we don't want a row to be higher than another row when one of the cells has a very long piece of text.
The text may be hidden via something like "overflow:hidden" (Which we tried to do, but didn't seem to work), or be cutoff replacing the end of the string with a few dots.

Replies

  • RemiDGRemiDG Posts: 15Questions: 0Answers: 0
    bump
  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Two options:

    1. Put the text of each cell in a `div` wrapper and just set the width on that.

    2. Use `table-layout: fixed` in your CSS, which has a similar effect, but isn't well tested or supported with DataTables.

    Allan
  • RemiDGRemiDG Posts: 15Questions: 0Answers: 0
    Ah, nice. Thanks.
This discussion has been closed.