sScrollY and dynamic column widths

sScrollY and dynamic column widths

TPTP Posts: 3Questions: 0Answers: 0
edited May 2013 in General
I'm using DataTables for our BI/reporting system. Currently I'm experimenting with the sScrollY option, so header and footer rows will always be visible.

Options are basically this:

[code]
{
"bJQueryUI" : true,
"bPaginate" : false,
"bAutoWidth" : false,
"sScrollY": "300px",
"bScrollCollapse": true,
"aaSorting": [],
"asStripeClasses": ["odd", "even"]
}
[/code]

plus a callback handler for the filter function.
I also have a resize handler on the window, which sets the height of dataTables_scrollBody, so the table uses all available height.

This is working well, with only one issue: The table also uses all available width, which looks rather strange, if there are only a few columns.
Without the sScrollY option, the table is only as wide as neccessary, but when the option is present, it will fill the whole window.

Is there any way around this? How can I use the sScrollY option without the table taking up all available width?
This discussion has been closed.