DataTable with scrollY not automatically resizing if inside a Table TD

DataTable with scrollY not automatically resizing if inside a Table TD

c55v8c55v8 Posts: 12Questions: 2Answers: 0
edited March 2017 in Free community support

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:

  1. 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.
  2. Enclose the DataTable TABLE element in a DIV.
  3. 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

  • c55v8c55v8 Posts: 12Questions: 2Answers: 0

    Just bumping this up. Still haven't figured this out one. Hoping there's someone out there who know.

This discussion has been closed.