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

ZhongCaiZhongCai Posts: 4Questions: 0Answers: 0
edited April 2013 in General
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

Replies

  • allanallan Posts: 63,522Questions: 1Answers: 10,473 Site admin
    Please link to a test case showing the issue: http://datatables.net/forums/discussion/12899/post-test-cases-when-asking-for-help-please-read .

    I would also suggest you remove sScrollXInner as it usually isn't needed.

    Allan
  • ZhongCaiZhongCai Posts: 4Questions: 0Answers: 0
    I found if I clicked the header the header's width will be correct ,it change to fit the body's width.
    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.
  • ZhongCaiZhongCai Posts: 4Questions: 0Answers: 0
    This mean when I call fnAdjustColumnSizing() it don't calculate the header size, I want to know what function can calculate ? By trace dataTable libary, it seem to difficultly to find the func.

    I try to simulate the click ,but it also can not active.
  • ZhongCaiZhongCai Posts: 4Questions: 0Answers: 0
    referance
    http://datatables.net/examples/api/tabs_and_scrolling.html

    in tabs show event, call fnAdjustColumnSizing, have fix it.
This discussion has been closed.