scrollX not work with fixed column width
scrollX not work with fixed column width
yusran
Posts: 2Questions: 0Answers: 0
Hi All...
Can i activated scrollx with fixed column width??
my code like:
var table = $('#table').dataTable({
"scrollX": true,
"aoColumns": [
{ "sWidth": "130px" },
{ "sWidth": "20px" },
{ "sWidth": "80px" },
{ "sWidth": "160px" },
{ "sWidth": "100px" },
{ "sWidth": "80px" },
{ "sWidth": "80px" },
{ "sWidth": "50px" },
{ "sWidth": "100px" },
{ "sWidth": "100px" },
{ "sWidth": "120px" },
{ "sWidth": "80px" },
{ "sWidth": "50px" },
{ "sWidth": "50px" },
{ "sWidth": "80px" },
{ "sWidth": "80px" },
{ "sWidth": "20px" }
]
});
The scrollX is working but not with the column width...
If i remove the "scrollX": true, column witdh is working..
can the both working well?
This discussion has been closed.
Replies
@Allan
I think that the scrollx creates a 2nd table, so that breaks the relationship between the columb widths in the header and the body, say if the content messes with it.
Not sure if theres a fix
Can you link to a test case showing the issue, as per the forum rules, please. This should work okay - there is a second table, but Javascript is used to align the two tables. We'd need a test case to understand why it isn't working.
Please also ensure that you are using DataTables 1.10.10 which fixes a number of column width issues from previous versions.
Allan