Inconsistent column widths with infinite scrolling and server side data

Inconsistent column widths with infinite scrolling and server side data

rheiciderheicide Posts: 1Questions: 0Answers: 0
edited August 2013 in DataTables 1.9
I'm using a datatable in a jQuery dialog, initialize it with infinite scrolling and load data from server.

The column widths do not stay the same as additional data are added to the table, which I think is normal as the length of data inside those columns change. However, I want their width to be consistent so that users feel more comfortable about the UI.
I've tried setting bAutoWidth to false and defining column widths in aoColumnDefs (and same widths for the th elements as well) but the inconsistency is still there.

Then I set CSS table-layout to "fixed" for the table and word-wrap to "break-work" for the td elements, this time the column widths are consistent, the table looks fine in most browsers except IE: there is a horizontal scroll bar at the bottom, which can be scrolled only a little bit to the right. I increased the width of the table to see if that was because it was too narrow, but that didn't work.

For now I'm not using the "fixed" table-layout and allowing the column to wiggle a bit but it would be nice if they are consistent.

Has anyone here had the solution for this? Thank you in advance.

Replies

  • ladislav2ladislav2 Posts: 13Questions: 0Answers: 0
    Hi, I have the same problem. Have you resolved this ? Thank you for your response.
  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin
    There isn't really a fix for this I'm afraid, other than the fixed table layout as rheicide suggests. This is one of the many reasons why infinite scrolling is deprecated in DataTables 1.9 and removed in 1.10!

    Allan
This discussion has been closed.