I've been having this problem, when scrollY is true my th columns loose ther original width.
But after sorting or paging this width is corected.
Does anybody have a solution to this.
I'm using v1.7.2
Is the table hidden (display: none) when they are initialised? Something like this might help: http://datatables.net/examples/api/tabs_and_scrolling.html
Not sure quite what you mean. $('table.display').dataTable(...) in the link above will initialise DataTables on any element which matches that selector (i.e. any table element with a 'display' class). See: http://datatables.net/examples/basic_init/multiple_tables.html .
It just ensures that the table element with a class of display is a child of the div with a class of dataTables_scrollBody: http://api.jquery.com/child-selector/ .
I just ran across a problem with the example in http://datatables.net/examples/api/tabs_and_scrolling.html. It assumes there is only one dataTable in each tab, so any tabs with more than one table will only have one of its tables' columns adjusted. The "show" function for the tabs should be the following:
var oTables = $('div.dataTables_scrollBody>table.display', ui.panel);
for (var i = 0; i < oTables.length; i++) {
var oTable = $(oTables[i]).dataTable();
oTable.fnAdjustColumnSizing();
}
Replies
Allan
Allan
Not sure what the ">table.display" do.
Allan
var oTables = $('div.dataTables_scrollBody>table.display', ui.panel);
for (var i = 0; i < oTables.length; i++) {
var oTable = $(oTables[i]).dataTable();
oTable.fnAdjustColumnSizing();
}