DataTables / FixedHeader

Fix the header, footer, left or right columns of a table in place, to always show them when scrolling
http://www.datatables.net/
Other
75 stars 83 forks source link

header height is set to zero and invisible when in tabs #106

Closed wiwiyo closed 2 years ago

wiwiyo commented 2 years ago

At the 283th line in dataTables.fixedHeader.js, multi table headers's height is set to the same value.When I hava tabs in my page, there are some tables is invisible, so the function will calculate the height as zero and set the value to all tables so that all tables are invisible.

AllanJard commented 2 years ago

When the table is made visible you need to call [fixedHeader.adjust()](https://datatables.net/reference/api/fixedHeader.adjust()).

If that doesn't resolve it for you, please link to a test case showing the issue.

wiwiyo commented 2 years ago

When the table is made visible you need to call [fixedHeader.adjust()](https://datatables.net/reference/api/fixedHeader.adjust()).

If that doesn't resolve it for you, please link to a test case showing the issue. tableInTab.txt It seems like that header is visible when scrollX is false.

AllanJard commented 2 years ago

Many thanks! That's the fix committed :)

wiwiyo commented 2 years ago

Many thanks! That's the fix committed :)

I'm sorry to bother you again.With your fix, it is ok with table1 in my test case, but table2's header is still invisible. I tried to call fixedHeader.adjust(), and I found that this method did not reset the value of $('div.dataTables_scrollHeadInner').Since table2's height is zero when it is inited, it's height will always be zero.

SandyDatatables commented 2 years ago

Hi @wiwiyo ,

I've taken a look at that line and it looks as though it isn't actually necessary so I have removed it - shouldn't cause an issue for you now. Take a look at this example using the nightly builds.

Thanks, Sandy

wiwiyo commented 2 years ago

Hi @wiwiyo ,

I've taken a look at that line and it looks as though it isn't actually necessary so I have removed it - shouldn't cause an issue for you now. Take a look at this example using the nightly builds.

Thanks, Sandy

Thank you for the solution.