Open althaus opened 7 years ago
For the most part the position of the fixed element in the DOM doesn't actually matter (since it is position: fixed
). However, at the transition point when the table gets to the top of the page and the header has to scroll off, it needs to be position: absolute
for that to work. At that point the positioning in the DOM is important. I used body
because it simplifies things a lot. It probably would be possible to put it in next to the DataTable itself using the correct offset parent.
If that is implemented it would be easier to just make that the method used rather than providing an option for the container.
I'd be fine with that. Dunno if someone needs to rely on the body
-placement and changing the DOM position would be a BC break now.
We've got still some issues with form and FixedHeader/Footer (#68). Wouldn't it be sufficient to make the container configurable? At the moment the floating footer get's appended to
body
. If we'd move it out of thetable
into the surroundingform
it'll still work out-of-the-box:Before DT triggers:
Current version:
Alternate solution:
https://github.com/DataTables/FixedHeader/blob/master/js/dataTables.fixedHeader.js#L285
Cheers Matthias