Stop the table header from scrolling?

Discussion in 'HTML & Website Design' started by bgjyd834, Apr 27, 2011.

  1. #1
    I have a scrollable table javascript that I am using. I would like to know how I can keep the header from scrolling out of view. I would like to make it fixed. How can I do this??
    Thanks
     
    bgjyd834, Apr 27, 2011 IP
  2. easilydoable

    easilydoable Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Can you post a sample code or point me to the page where you have this scrollable table?
     
    easilydoable, Apr 27, 2011 IP
  3. eruct

    eruct Well-Known Member

    Messages:
    1,189
    Likes Received:
    49
    Best Answers:
    0
    Trophy Points:
    108
    #3
    A sample of the code would be helpful but what you will most likely need to end up doing is playing with the positioning of the header using CSS. So say your header is called #header. You would add the style
    #header{
    position:absolute;
    top:0;
    left:0;
    }
    This will take the header out of the normal flow of the webpage and force it to always be on the top left.
    You can make this relative to the rest of your site like force it to be in the top of a 'wrapper'... this is where seeing your actual site/code would be extremely helpful.
    Also, I recommend checking out this quick tutorial about using CSS positioning
     
    eruct, Apr 27, 2011 IP