FixColumn adding unnecessary thead
FixColumn adding unnecessary thead
bortonj
Posts: 5Questions: 1Answers: 0
my fixed columns have an unnecessary empty header being added which pushes everything down in the fixed columns.
when I look at the html in the browser I see the following (simplified):
div class="DTFC_ScrollWrapper ....
<pre>div class="DTFC_RightWrapper .... </pre>
div class="dataTables_scroll ...
div class="DTFC_LeftWrapper ...
div class="DTFC_LeftHeadWrapper ...
table class="table....
thead.../thead <<< this is ok
/table
/div
div class="DTFC_LeftBodyWrapper. ...
div class="DTFC_LeftBodyLiner ...
table class="table....
thead...</thead <<<<< this shouldn't be here, it's not needed and it's empty but pushing the tbody down
tbody...</tbody
/table
Anyone know why the second empty thead is being added to the DTFC_LeftBodyWrapper?
This discussion has been closed.
Answers
to temporarily correct this I've added the following after I load the data in the table:
Yes I could probabliy just remove the thead, but for now chose this route.
I've just had this problem recently myself, are you using the sScrollX option when initialising the table?
yes, I've set scrollX to true.
Can you link to the page so I can take a look, or link to a test case showing the problem please?
Thanks,
Allan
Allan, this is an internal page so I cannot do that.
I'll see if there is a way to scale back the site to a generic table to demonstrate the problem.
a bit more debugging... It appears like the sort icons are causing the 'second' <thead> to show (even though the height is set to 0). The icons show in both the correct header and incorrect header. If I turn off sorting on those columns everything displays correctly. However I need to sort on the first column so I'm caught in a catch-22.
any ideas?
Are you using the Bootstrap integration? If so, please try the latest files from here.
Failing that, I really would need a test case on JSFiddle, http://live.datatables.net , CodePen or similar.
Allan