Limiting column widths
Limiting column widths
StanAccy
Posts: 31Questions: 5Answers: 0
We are generating a table with Datatables 1.10 on the server side and sending the whole set of JS + data back to the client.
Its working very well, with one exception - column widths.
Right now, it looks like Datatables has run some algorithm to set column widths and its set the width property on each <th>.
Is there a way to hook in to the width generation and provide a max-width limit along with appropriate word-break / word-wrap options?
This discussion has been closed.
Answers
Could we add an additional value to the aoColumns like sWidthMax, or is it possible to provide our own implementation of the _fnCalculateColumnWidths() method?
We'd basically just copy that method and put a cap on max col width, allocating any excess space to the widest column, and also set word-wrap/word-break on each col.
This seems to work - comments please:
Now that Ive used this, I realized that I dont want to set this property on a per column basis, but on the entire table, as a single setting. Could this be done at a table wide level?