Reputation: 1211
I am using jQuery datatable plugin. I am rendering my html table first and then applying the plugin. It has some issues.
Issues:
Header column and body columns are not aligned.
If there are a lot of columns (columns are generated dynamically not possible to set a fix width of columns) the data table grows horizontally.
Sample Code :
var scrollY = $(window).height() * 80 / 100;
var oTable = $('#myTable').dataTable({
"sScrollX": "100%",
"sScrollY": scrollY,
"bScrollCollapse": true,
"bPaginate": false,
"bStateSave": false,
"bFilter": false,
"bInfo": false,
"bAutoWidth": false,
"bSort": true,
"aaSorting": []
});
oTable.fnAdjustColumnSizing();
This is how my table is looking
EDIT I am using this plugin inside JQuery tabs.
Upvotes: 0
Views: 305
Reputation: 2627
First I would control the html structure before creating the datatable. It has to be like the following:
<table id="myTable">
<thead>
<tr>
<th></th>
<th></th>
// exact number of th present in the datatable
</tr>
</thead>
<tbody>
</tbody>
</table>
then i would try to set:
"bAutoWidth": true
even if it's difficult to solve your problem without HTML code...
Upvotes: 1