Proposal: Fixed Table Headers in CSS

Hi, CSS WG-

Sometimes, I will make long tables that span multiple screens.  Ideally, 
as the page is scrolled, there would be a CSS option to keep the table 
headers on the top of the screen, until the last row is scrolled past, 
so that readers have an easy reference to the headers for each column.

I know that there are ways to do this with scrollable table content 
areas [1], but this is not what I'm talking about... I'm talking about a 
property that would automatically fix the position of the headers at the 
top of any table's containing block even when the table body is part of 
the normal display of the page, and doesn't have its own scrollbar.

I don't think this would be a general property that might be applied to 
any other kind of content I can think of... I think it is specific to 
table headers.  I chatted with Tab a bit about this... we aren't sure 
where it would go, but hopefully it could fit in some spec currently 
under development.

I haven't thought too deeply about the behavior of vertical/row headers. 
  Ideally, it would not be a set of properties, but a single 
special-cased property on the <table> element, something like 
'fixed-header: none | horizontal | vertical | both'.  I'm not concerned 
about the syntax, that's just a suggestion.  (I know there are 
challenges with having both vertical and horizontal headers fixed, but 
each would be fixed relative to the whole document's scrollable area 
with respect to the direction of scrolling, not to the other header.  If 
it came down to picking one, I'd rather have fixed column headers.)

[1] http://schepers.cc/html/fixedheader.html (doesn't work in IE)

Regards-
-Doug Schepers
W3C Team Contact, SVG and WebApps WGs

Received on Thursday, 10 December 2009 03:33:57 UTC