Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Align Two Tables Vertically

 
Steve Dyke
Ranch Hand
Posts: 1629
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have two tables which was originally one. But I want the table rows to be able to scroll and leave the header row visible. So I created a one row table fro the header and a second row for the data rows. Now even though I have set the width on each column in both tables the same I am still getting the columns out of align especially when the data row table displays a scroll bar.
 
K West
Ranch Hand
Posts: 58
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That is not the right way to do so. You may want to search google for Fixed header HTML tables. Or here is one JQuery plugin I have tried Scrollable Fixed Header Table

 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems like in another thread of yours (maybe it wasn't yours) I made this suggestion.

Create a thead section for your table as well as a tbody section. Make the tbody overflow: auto; and create an empty header column with a width of about 25px to account for the scroll bar.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic