I am trying to use this tutorial to allow efficient scrolling on a matrix widget I wrote. However, it uses absolute positioning on the infinite scrolling nodes it creates. My nodes are table rows and columns. That takes all of the cells out of table flow. Is there a way, to keep absolutely positioned table cells in flow?
I do know it is possible to absolutely position a div and keep it in flow with another div wrapped around it using relative positioning on the outer div. Something like:
<div style="position:relative"><div style="position:absolute;top:0;left:0"></div></div>
However, that will not work in this case due to the outer html being a table body with a header and the inner html being table rows. Is there any way to apply relative positioning to a part of a table to force absolutely positioned table cells to stay within the table and keep their alignment with the table header?
I have tried applying relative positioning on various parts of the table surrounding the absolutely positioned rows like:
<table border="1">
<thead><tr><th>header</th><th>another header</th></tr></thead>
<tbody style="position:relative">
<tr style="position:absolute">
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
</tr>
<tr style="position:absolute">
<td><input type="checkbox"/></td>
<td><input type="checkbox"/></td>
</tr>
</tbody>
</table>
Is it possible to modify the above snippet so the cells stay in flow with the thead section and the rest of the table? The same relative positioning trick that works for divs, does not seem to work for table content.