Columns are not resized when changing browser window dimensions
Columns are not resized when changing browser window dimensions
tr333
Posts: 12Questions: 0Answers: 0
I've found a problem with table resizing and hidden columns in 1.9.0.
If you view the test case in a browser window at full screen size and then resize the browser window to be smaller, then the columns in the table are not resized to fit in the new table dimensions. This only occurs in the test case when the first column is hidden. If "bVisible" is set to "true" for column 0, then the problem disappears and the column widths are resized correctly.
Test case:
http://live.datatables.net/azuxag/2
If you view the test case in a browser window at full screen size and then resize the browser window to be smaller, then the columns in the table are not resized to fit in the new table dimensions. This only occurs in the test case when the first column is hidden. If "bVisible" is set to "true" for column 0, then the problem disappears and the column widths are resized correctly.
Test case:
http://live.datatables.net/azuxag/2
This discussion has been closed.
Replies
See: http://datatables.net/release-datatables/examples/basic_init/flexible_width.html
Allan
[code]table.dataTable {
border-collapse: collapse;
width: 100%;
}[/code]
Any particular reason why border-collapse is not set for the themeroller stylesheet on the CDN? People may disagree with me, but I think it looks much nicer to not have any borders between the table cells with the themeroller stylesheet enabled. Not that it really matters, since it's trivial to add the CSS to change this.
Yes - I forgot to put it in :-(
I've just added it and it will be in 1.9.1 on the CDN, which will be released in the not to distant future (hopefully about a week).
Allan
I just realised I had to use [code]width: 100% !important;[/code] as it was only working for some of my tables and not others. Not sure what was overwriting the CSS declarations.