By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,493 Members | 1,920 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,493 IT Pros & Developers. It's quick & easy.

Scrolling tables ?

P: n/a
What I want to be able to do is to present a table (with 3 varying
width columns) as a scrolling list of items.
I can do this by placing the table within a div which has overflow-y
set to scroll - however when the table is scrolled the table header
row scrolls out of view.

Is there a way to format this so that the header is outside of the
scrollable area but still aligns with the (varying width) columns
which contain the table data ?
If each column was a fixed width it would be easy - but I don't see
any way to take varying width columns into account.
Jul 20 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
SmartBloke wrote:
What I want to be able to do is to present a table (with 3 varying
width columns) as a scrolling list of items.


<table>
....
<thead>
.... header row ...
</thead>
<tbody>
.... data rows ...
</tbody>
</table>

apply the overflow to tbody.
--
Johannes Koch
In te domine speravi; non confundar in aeternum.
(Te Deum, 4th cent.)
Jul 20 '05 #2

P: n/a
DU
Johannes Koch wrote:
SmartBloke wrote:
What I want to be able to do is to present a table (with 3 varying
width columns) as a scrolling list of items.

<table>
...
<thead>
... header row ...
</thead>
<tbody>
... data rows ...
</tbody>
</table>

apply the overflow to tbody.


What you wrote will work only for Mozilla-based (1.2+) browsers.

Cross-browser scrolling tbody
http://www10.brinkster.com/doctorunc...lingTBody.html

DU
Jul 20 '05 #3

P: n/a
DU <dr*******@hotWIPETHISmail.com> wrote in message >
Cross-browser scrolling tbody
http://www10.brinkster.com/doctorunc...lingTBody.html


Thanks for your reply, this looked good at first glance, however,
looking deeper it does not allow for variable width columns -
stripping the 'col widths' and the 'table-layout: fixed' from your
code breaks the alignment of the table header and body.

I am generating a table dynamically from a php script - I have no idea
of what the content of the table is going to be so I cannot give
columns widths either relative or absolute - the table must reflow to
accomodate the headings/data.

Possible ?
Jul 20 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.