The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Programming Fundamentals" Dec 02 - 2:00 PM Eastern

position: fixed on a table row?

  • # March 12, 2009 at 9:58 am

    I want to make a table such that the heading row stays in place as you scroll, so you always know what information you’re looking at underneath. I tried setting "position: fixed" on the table row, but then the cells "collapse" (they shrink to just large enough to fit their text, no longer aligning with the rows underneath).

    Is there any good way to do this?

    # March 12, 2009 at 11:26 am

    This thing is awful and I hate looking at it now, but that’s what I was going for here:

    The things is… it’s not really a table row up top it’s just an image. I’m not sure if table rows will respect fixed positioning. I assume they do not, they have their own special positioning rules. Likewise, you can’t adjust a cell with relative positioning (and stuff like that).

    # March 12, 2009 at 1:39 pm

    This reply has been reported for inappropriate content.

    Yeah, that’s what I figured. When I set position: fixed it looks like it takes the row out of the normal "flow" of the table, and everything gets screwy (like the background color from the row underneath moves up behind the fixed row above it).

    I guess an image – or just a separate div rather than a table row – is the way to go.

    # March 12, 2009 at 1:47 pm

    I’ve seen this done somewhere – let me have a look around :) *checks bookmarks…*

    AHH HA!

    Any good?

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed