We have a beforeValueRender function which truncates the text rendered into the DOM for cells which exceed a certain character count. The full text remains available for the user to view and manipulate upon editing the cell content.
In our table’s settings object, we use the columns object to define properties of every column, including specific widths for every column. These defined widths cause some text cells with longer contents to grow in height. However, some of our users would like to remove our preset widths and allow the truncated text of every cell to stretch the width of the columns, so that every row in the table consists of one line of text. So we have added a button to the page which removes the width property from every column. When the button is clicked, the columns do indeed expand in such a way that every row in the table consists of one line of text.
However, we have found that the columns expand to accommodate the full, non-truncated text that is not displayed to the user. We would prefer the columns to expand only as far as the truncated text that is being rendered.
Is there a way to make the column only as wide the truncated, rendered text rather than the full text in the cell?