SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Guru quenting's Avatar
    Join Date
    Dec 2002
    Location
    Switzerland
    Posts
    735
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    tables, scrolling and css

    ok here's one for you css experts i can't figure out.
    i have a table (yes, with tabular data) with variable number of lines and columns, which is supposed to stay within a certain area of the screen.
    If the number of columns or lines becomes too large i want to be able to scroll the table.
    So far it's an easy one :

    <div style="width:300px; height:300px; overflow:auto;">
    <table>
    <tr><!--some ths--></tr>
    <tr><!--some tds--></tr>
    <tr><!--some tds--></tr>
    <tr><!--some tds--></tr>
    <tr><!--some tds--></tr>
    <tr><!--some tds--></tr>
    </table>
    </div>

    Now here's the problem: when i scroll horizontally, i want the table headers to scroll at the same time as the rest of the table, BUT when i scroll vertically through the table lines, i'd like to be still able to see the headers.
    It sounds like i should use thead and tbody styling but i can't figure ouot how, i have tried a few combinations and none gave me the expected results...

    Thanks for any help
    Quentin
    The largest message boards on the web !
    unblog.fr, hosting 700000 french blogs

  2. #2
    You talkin to me? Anarchos's Avatar
    Join Date
    Oct 2000
    Location
    Austin, TX
    Posts
    1,438
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think you'd need to use dhtml to achieve this effect, and it won't be easy at all.
    ck :: bringing chris to the masses.


Bookmarks

Posting Permissions

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