HighDots Forums  

Table with fixed header row and scrolling content?

Cascading Style Sheets Layout/presentation on the WWW (comp.infosystems.www.authoring.stylesheets)


Discuss Table with fixed header row and scrolling content? in the Cascading Style Sheets forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Big Slim
 
Posts: n/a

Default Table with fixed header row and scrolling content? - 09-05-2003 , 07:07 AM






I'm trying to use the OVERFLOW property to make only part of a table
scrollable, but to no avail.

You can split a table into two tables, with your column headers in the
top table and your data in the bottom table. This allows you to scroll
trough lots of data with the header stationery, but of course then the
column widths vary and the header table doesn't align properly with the
data data.

When I use a DIV around the data rows, its OVERFLOW property has no
effect.

Anybody know how to accomplish this? Or if it's even possible??

TIA--Big Slim

Reply With Quote
  #2  
Old   
Philipp Lenssen
 
Posts: n/a

Default Re: Table with fixed header row and scrolling content? - 09-05-2003 , 07:44 AM






Big Slim wrote:

Quote:
I'm trying to use the OVERFLOW property to make only part of a table
scrollable, but to no avail.



Anybody know how to accomplish this? Or if it's even possible??


Theoretically, tbody, tfoot and thead should help. In practice I had no
luck setting CSS-overflow for those elements.
http://outer-court.com/tech/tutorials/advanced-tables/

--
Google Blogoscoped
http://blog.outer-court.com


Reply With Quote
  #3  
Old   
SantaKlauss
 
Posts: n/a

Default Re: Table with fixed header row and scrolling content? - 09-06-2003 , 05:33 PM



Big Slim wrote:

Quote:
I'm trying to use the OVERFLOW property to make only part of a table
scrollable, but to no avail.
You can split a table into two tables, with your column headers in the
top table and your data in the bottom table. This allows you to scroll
trough lots of data with the header stationery, but of course then the
column widths vary and the header table doesn't align properly with the
data data.
When I use a DIV around the data rows, its OVERFLOW property has no
effect.
Anybody know how to accomplish this? Or if it's even possible??
Hi Big Slim,
just don't have the time to try, but I think it's possible. Just some hints.
First, you can try to style up with fixed height and overflow the <tbody>
using <thead> for the table header. If it doesn't work, and I suppose it
wouldn't, you could force tbody to have a block-level-element behaviour:

tbody{
display: block;
height: 300px;
overflow: auto
}

If even this doesn't work, you could nest a table into a <td> with
overflow set. The matter is that overflow in <td> doesn't work
properly in some browsers. The workaround to allow overflow
in a table cell is to put in it a div with overflow set. Here's the
code for the cell with overflow:

<td style="width: 200px; height: 400px">
<div style="width: 100%;height: 100%;overflow: auto">
<!--here you can put content table-->
</div>
</td>

If the columns of the two tables aren't aligned, you can always force
via css the cells of the header of the containg table and the cells of
the content table to have same width.

HTH,
SantaKlauss

P.S: I don't think you could put a div in a table in order to contain some
rows... try to validate the code for being sure of this.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.