• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Table with header fixed.

Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to create a table with its header fixed when I scroll horizontally. Right now, I am trying to do this by writing the header and the body as separate tables. I am also putting the body table under a div and forcing scroll by specifying a height. The problem is that due to the scroll bar, the body table columns are not aligning with the header table columns though the width of the cells is the same. As long as the scroll bar is not appearing (meaning the data in the body table fits within the specified height of the div), the columns align perfectly. Is there a way to resize the columns dynamically so that they are aligned properly? I have seen a post in this topic for having a scrollable table using the same logic.
My other question: is there any other way of doing this so that the header remains stationary and the body of the table can be scrollable and also maintaining the column alignment?
Any suggestions are greatly appreciated!!!
Thank you
Posts: 15385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do a search on this forum. The code should be here.
They worship nothing. They say it's because nothing lasts forever. Like this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic