HTML table headers always visible at top of window when viewing a large table

Posted by Craig McQueen on Stack Overflow See other posts from Stack Overflow or by Craig McQueen
Published on 2009-06-23T00:17:12Z Indexed on 2010/06/05 13:42 UTC
Read the original article Hit count: 497

Filed under:
|

I would like to be able to "tweak" an HTML table's presentation to add a single feature: when scrolling down through the page so that the table is on the screen but the header rows are off-screen, I would like the headers to remain visible at the top of the viewing area.

This would be conceptually like the "freeze panes" feature in Excel. However, an HTML page might contain several tables in it and I only would want it to happen for the table that is currently in-view, only while it is in-view.

Note: I've seen one solution where the table data area is made scrollable while the headers do not scroll. That's not the solution I'm looking for.

© Stack Overflow or respective owner

Related posts about html

Related posts about table