SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Freeze / Lock Table Column and Header

    Hi,

    I've been looking for a solution to this for a long time now, but I can't find anything that works in both Internet Explorer and Firefox.

    I would like to lock the first column, so that when the table is scrolled left and right, you can easily see which times belong to which users.

    It can use Javascript, but it must work in both firefox and javascript.

    I've tried searching google for a solution, but I can not find any that work in firefox, and lock the first column properly.

    Image should be attached to this post.

    Thanks
    Attached Images Attached Images

  2. #2
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The only way I can think of is to have a table with two columns. in your first is the locked column and in the second, the content you want to scroll...

    Then you use css to make the second section scrollable.


  3. #3
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes I did think of this as well, but how would I keep the heights of the rows the same so that they still matched?

  4. #4
    SitePoint Wizard gRoberts's Avatar
    Join Date
    Oct 2004
    Location
    Birtley, UK
    Posts
    2,439
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can't really work on a solution at the moment, but I will try and have something for you soon.


  5. #5
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Still haven't figured this out. If only colgroups worked in firefox.

  6. #6
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,729
    Mentioned
    104 Post(s)
    Tagged
    4 Thread(s)
    It will be possible if you have javascript build a new table containing the first two columns, ans also remove the first column from the original table. This allows the vertical spacing to be retained, and the second column need not be shown.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  7. #7
    SitePoint Member
    Join Date
    Aug 2008
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have attached a text file, change the extension to html

    Is there anyway to make the .holder table stretch with the browser, so it will show the largest possible amount of the .data-table.

    Thanks
    Attached Files Attached Files

  8. #8
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I came across this thread when I was researching the same question. I later found this blog entry (dating from 2006) which appears to solve the problem:

    www[dot]cubido[dot]at/Blog/tabid/176/EntryID/8/Default.aspx

    (sorry for obscuring the link, but the system wouldn't let me post a link...)

    Hopefully this will help the next person who is wondering this!


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
  •