So, I took some time today to ponder ways of allowing TBody elements to be scrollable, and came up with a solution in jQuery, that is compatible with pretty much any browser that supports jQuery. One of the biggest desires for DOM developers using tables, is to have a scrollable tbody, to allow table headers to be visible no matter where in the table you scroll to…

The idea I had was, getting widths of columns, saving this data into an array, and then passing back this data as css widths onload and then moving the header row to a separate table.

After some messing around, I was able to come up with a solution to the issue, and am proud to offer a working example!

http://jsfiddle.net/pe295/

Although it does add an additional table to the page, at the end of the day, I’m okay with a greater interaction for the user, over a few lines of code…

Advertisements