Thead and Tbody be divided into two table and don't match in width
Thead and Tbody be divided into two table and don't match in width
The Jquery code and result html is as following. Could anybody help me?
objectStateAdminDataTable = $('#qualityTabTable').dataTable(
{
"bJQueryUI" : true,
"sPaginationType" : "full_numbers",
"bAutoWidth" : true,
// "bDestroy" : true,
"sScrollX" : "100%",
"sScrollXInner" : "120%",
"aoColumns" : [
null, // Carrier
null,
null, null, null, null, null, null, null, null,null //CC:Single Line
],
"iDisplayLength" : 5, //CC:Single Line
"aLengthMenu" : [ [ 5, 10, 25, 50, -1 ],
[ 5, 10, 25, 50, "All" ] ], // Show entries
//"aaSortingFixed" : [ [ 0, 'asc' ] ], // Carrier ID column is fixed sorting
"aaSorting" : [ [ 0, 'asc' ] ]
// TODO this column does not exist so probably is not doing/affecting
});
Carrier ID
Plan ID
...
...
ApexHealth
Apex_Bronze_3500_TC
Not Available
Not Available
Not Available
Not Available
Apex Bronze 3500
PPO1
24.99
objectStateAdminDataTable = $('#qualityTabTable').dataTable(
{
"bJQueryUI" : true,
"sPaginationType" : "full_numbers",
"bAutoWidth" : true,
// "bDestroy" : true,
"sScrollX" : "100%",
"sScrollXInner" : "120%",
"aoColumns" : [
null, // Carrier
null,
null, null, null, null, null, null, null, null,null //CC:Single Line
],
"iDisplayLength" : 5, //CC:Single Line
"aLengthMenu" : [ [ 5, 10, 25, 50, -1 ],
[ 5, 10, 25, 50, "All" ] ], // Show entries
//"aaSortingFixed" : [ [ 0, 'asc' ] ], // Carrier ID column is fixed sorting
"aaSorting" : [ [ 0, 'asc' ] ]
// TODO this column does not exist so probably is not doing/affecting
});
Carrier ID
Plan ID
...
...
ApexHealth
Apex_Bronze_3500_TC
Not Available
Not Available
Not Available
Not Available
Apex Bronze 3500
PPO1
24.99
This discussion has been closed.
Replies
I would also suggest you remove sScrollXInner as it usually isn't needed.
Allan
I also add fnAdjustColumnSizing() when tab change as the following, but I found if I add fnAdjustColumnSizing() when tab change, after tab change to the tab I want to show, the width will change back to the before after I I clicked the header the header's width will be correct ,it change to fit the body's width.
bindPlanTabs : function(data, planStatus) {
$('#plansTabs').tabs({
if (selectedTab == 3) {
$("#qualityTabTable").dataTable().fnAdjustColumnSizing();
//$(".dataTable tr").trigger("click");
}
}
});
},
I am sorry the original code is too big, I can not set it all to the test site. I will set the need part to the site lately.
I try to simulate the click ,but it also can not active.
http://datatables.net/examples/api/tabs_and_scrolling.html
in tabs show event, call fnAdjustColumnSizing, have fix it.