DataTable with scrollY not automatically resizing if inside a Table TD
DataTable with scrollY not automatically resizing if inside a Table TD
I wanted to create a test case / JFiddle for this but it's not possible to recreate it there because the output screen is contained in a DIV.
Anyway, it's quite easy to recreate it:
- Create a simple DataTable with scrollY:100px. I have also "autoWidth" and "scrollCollapse" set to true, but I'm not sure if they are part of the issue.
- Enclose the DataTable TABLE element in a DIV.
- Then put that DIV inside a TD of another bigger TABLE. So you'll basically end up with:
<table id="wrappingTable" width="100%">
<tr>
<td width="100%">
<div style="width:100%">
<table id="theDataTable" width="100%">
.......
</div>
</td>
</tr>
</table>
Now, render the table and notice that when you re-size your browser, the DataTable doesn't re-size automatically. But if you comment out the scrollY option, it re-sizes properly. Or simply put the DIV outside the table and it automatically re-sizes fine too.
However, my requirement is to render it inside a TD.
I have set width=100% on all wrapping DIVs, TABLEs and TDs, but it didn't help.
Any ideas?
Answers
Just bumping this up. Still haven't figured this out one. Hoping there's someone out there who know.