Results 1 to 8 of 8
  1. #1
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Table header row

    This is probably not possible, but here goes:

    Apart from using a frameset, is it possible to use HTML/ CSS (or JS or anything else not visible on the rendered page) to produce a table in which the header row will remain visible at the top, during vertical scrolling? Similar to the "freeze panes" in Excel?

    Alan

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Table header row

    You should be able to use an <iframe>, which really is a simplified frameset.

    There also are some tricks with <div> containers that allow you to hold one fixed and scroll the other one past it, or to set it to a fixed size with a scroll bar. Off the top of my head, I'm not aware of any examples like the one you describe, but maybe I can mock one up...

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Table header row

    Here's a sample that isn't identical in IE and Fx, but in the parts most relevant to your original request, it renders the same. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    (Rename from _html.txt to .html)
    Attached Files Attached Files

  4. #4
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Table header row

    What can I say? Totally excellent! I think HTML must have progressed somewhat since I dabbled. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

    Many thanks. <img src=/S/thankyou.gif border=0 alt=thankyou width=40 height=15>
    Alan

    PS = Interestingly, the file attached renders (as is) as HTML in IE6, despite the .txt extension. ???

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Table header row

    I now have a further related question now. <img src=/S/grin.gif border=0 alt=grin width=15 height=15> I have allowed the table cell widths in the header area <th> to "fit contents" (whatever the correct terminology is) by not specifying a width=value. I'd like the column widths in the table body pane to assume these same "autofit" values, whatever they turn out to be for a particular table. Is this possible, or is it not advisable to try to do things that way? I'm using a stylesheet for this BTW, applied to lots of different tables.

    Alan

  6. #6
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Table header row

    If you don't specify the column widths, only by incredible luck will the two separate tables turn out the same.

  7. #7
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Table header row

    So it's not possible to "read" the widths determined by the autofit (into an array say) then set those widths in the subsequent tables, then rerender the page? ... or something clever like that?

    Alan

    Answer: Looks like it is, using scripting to control a Synchronized Scroll (WebFX). Seems to work as advertised.

  8. #8
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Table header row

    Just a cross-reference to a page linked in a post on another board (say that 3 times fast!): <A target="_blank" HREF="http://o2b.net/archives/dhtml-fun-scrolling-tables/">o2b.net

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •