Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

making a table scroll vertically

Status
Not open for further replies.

AntiEarnie

Technical User
May 2, 2002
215
US
Quick question. How can you force a table to scroll vertically? I can use the height setting to set the MINIMUM size of the table but if the table fills up more space then what is specified in the height command it just keeps growing.

i.e. setting height="200" on a table is about 10 lines.
If the table only holds 5 rows worth of stuff it vertically padds them. However, if the table has 150 rows then the height setting is ignored and all 150 rows are displayed taking up the entire screen.

Can anyone tell me what I'm doing wrong here? It just seems strange for height to set the Min height but not the Max height of the table.
 
try adding style="overflow:auto;" in your table attributes. If that doesn't work create a DIV with scroll:auto; and the wanted size of your table. Then make your table be 100% width and height. Gary Haran
 
Sadly using the style=overflow:auto didn't give me a max table height either. Though neither did style=height:200px. I've found 3 ways to set the minimum height of a table now...

Havent played with DIV's so I'm not sure about that one.
 
This is what Xutopia meant:

<div style=&quot;height:200px;overflow:auto;&quot;>
<table style=&quot;width:100%;height:100%;&quot;>......</table>
</div>

Note--you can still have other attributes for the <table>.

Rick -----------------------------------------------------------
RISTMO Designs
Arab Church
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top