Adding Width to table problem
Adding Width to table problem
veddermatic
Posts: 1Questions: 0Answers: 0
I have a viewport that is 500px wide. By default, DataTables adds 26px in width to the table to account for the scroll bars; understandable. To have the table scroll and still fit inside the 500px wrapper, I have tried several things to no avail. How can I get the table to be 500px wide *with* scrollbars?
Here's what I have right now:
[code]
/* CSS * /
#outer { width: 500px;}
#inner {width: 474px;} /* with or without, same effect */
#theTable { width: 474px;} /* with or without, same effect */
/* HTML */
...
/* DataTable Code */
jQuery('#theTable').dataTable({
"bFilter": false,
"sScrollY": "250px",
"bPaginate": false,
"bSort": false,
"bInfo": false,
"bAutoWidth": false //makes no difference
});
[/code]
I wind up with inline styles set to 526px on .dataTable_scrollHead and .dataTable_scrollBody
Anyone have any suggestions?
Thanks!
Here's what I have right now:
[code]
/* CSS * /
#outer { width: 500px;}
#inner {width: 474px;} /* with or without, same effect */
#theTable { width: 474px;} /* with or without, same effect */
/* HTML */
...
/* DataTable Code */
jQuery('#theTable').dataTable({
"bFilter": false,
"sScrollY": "250px",
"bPaginate": false,
"bSort": false,
"bInfo": false,
"bAutoWidth": false //makes no difference
});
[/code]
I wind up with inline styles set to 526px on .dataTable_scrollHead and .dataTable_scrollBody
Anyone have any suggestions?
Thanks!
This discussion has been closed.
Replies
Here is an example showing how it should work: http://live.datatables.net/ejizoy/edit (note the blue bar at the top os 500px and the DataTable aligns correctly with that).
Allan