Relative Widths on Columns when sScrollY is set
Relative Widths on Columns when sScrollY is set
Hi, I'm new, but have had a big hunt around, and got the answer to most of my problems but not quite all.
I have a table with relative formatting.
My call is currently
[code]
$("#products").dataTable({
"bJQueryUI": true,
"bPaginate": false,
"bScrollCollapse": true,
"aoColumnDefs": [
{ "sWidth": "10%", "aTargets": [ 0, 1, 3,4,5,6,7 ] } // 8 columns, by default column 2 is 30%
],
"bAutoWidth": false,
"sScrollY": "400px"
});
[/code]
Now, this is working fine on most of the table when I resize - the main body resizes correctly with percentages. However, the header row doesn't. If i remove the sScrollY component, it all resizes correctly. As soon as I put it back in, however, the table splits into two tables (dataTables_scrollHead and dataTables_scrollBody), and the header sets actual pixel widths, ignoring the bAutoWidth false. This happens whether I use aoColumns, aoColumnDef or in the table cell widths.
None of the previous questions I've read have mentioned this, though it has been noted that by removing sScrollY resizing works. I was wondering if anyone had a solution.
Thanks so much
Dianne
I have a table with relative formatting.
My call is currently
[code]
$("#products").dataTable({
"bJQueryUI": true,
"bPaginate": false,
"bScrollCollapse": true,
"aoColumnDefs": [
{ "sWidth": "10%", "aTargets": [ 0, 1, 3,4,5,6,7 ] } // 8 columns, by default column 2 is 30%
],
"bAutoWidth": false,
"sScrollY": "400px"
});
[/code]
Now, this is working fine on most of the table when I resize - the main body resizes correctly with percentages. However, the header row doesn't. If i remove the sScrollY component, it all resizes correctly. As soon as I put it back in, however, the table splits into two tables (dataTables_scrollHead and dataTables_scrollBody), and the header sets actual pixel widths, ignoring the bAutoWidth false. This happens whether I use aoColumns, aoColumnDef or in the table cell widths.
None of the previous questions I've read have mentioned this, though it has been noted that by removing sScrollY resizing works. I was wondering if anyone had a solution.
Thanks so much
Dianne
This discussion has been closed.
Replies
Allan