SitePoint Sponsor

User Tag List

Results 1 to 10 of 10
  1. #1
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    freeze the header of Table?

    How can I freeze the header of Table?
    [COLOR=SlateGray]
    Web Developer @ VeriQual

  2. #2
    Worship the Krome kromey's Avatar
    Join Date
    Sep 2006
    Location
    Fairbanks, AK
    Posts
    1,621
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Put it in the freezer!

    Not really sure what you're asking - what do you mean by "freeze" the header? And are we talking database tables or (X)HTML tables?
    PHP questions? RTFM
    MySQL questions? RTFM

  3. #3
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've a table and the data is coming from DB.

    I want that when page is scrolled down, the header of the table should be visible.
    [COLOR=SlateGray]
    Web Developer @ VeriQual

  4. #4
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    This isnt a php problem, its a layup problem.

    Your solution will depend on how you currently layup your data on the page, if your doing it correctly with <div></div> you could just put your headings in a seperate div above the div for your data, then make your data div scrollable.
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  5. #5
    SitePoint Wizard bronze trophy Kailash Badu's Avatar
    Join Date
    Nov 2005
    Posts
    2,560
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your solution will depend on how you currently layup your data on the page, if your doing it correctly with <div></div> you could just put your headings in a seperate div above the div for your data, then make your data div scrollable.
    Exactly.

  6. #6
    SitePoint Guru Ize's Avatar
    Join Date
    Nov 2005
    Location
    The Netherlands
    Posts
    808
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  7. #7
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Ize View Post
    If I use this technique then there might be some alignment problem. i.e.

    I have a table with data from DB. header of the table contains the the names of the columns. if cells of lower table expands due to large data, the clls in header won't expand and alignment problem can occure.

    Do u have any solution for this?
    [COLOR=SlateGray]
    Web Developer @ VeriQual

  8. #8
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You could use CSS instead for your table layout.

    You can define the width of the div cell, any overspill can wrap on a newline within the div, not breaking your layout.
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  9. #9
    SitePoint Zealot
    Join Date
    Jan 2007
    Location
    Australia
    Posts
    137
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I imagine you would have to define its position as absolute using CSS. However, what its absolute position is would have to be determined. You could calculate the distance between the top of the page and the top of the table row, but that's a hack, not real code.
    Last edited by Akash Mehta; May 9, 2007 at 23:46.

  10. #10
    SitePoint Member
    Join Date
    Feb 2005
    Location
    Lincoln
    Posts
    14
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


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
  •