Page 1 of 1

Scrollbars in table

Posted: Fri Mar 26, 2004 10:03 am
by Chris Corbyn
Hi,

I always used to use frames when building web sites and obviously scrollbars will appear if the page doesn't fit the frame.

I'm now building a site in PHP using tables. The only problem is I would like to add a scrollbar to one of my cells because it has a long list of links in it and it would just look silly having the entire table stetched to accommodate it all.

Any ideas? If you can change the color of the scrollbar it would be a bonus.

Thanks

Posted: Fri Mar 26, 2004 11:46 am
by PrObLeM
you cant have scroll bars in tables but what you can do is have it cut the string off after xxx amoun of charaters and put ... then they can click it and it will show the rest of the table

Posted: Fri Mar 26, 2004 12:33 pm
by Chris Corbyn
I found a solution.

You're right about not being able to have scrollbars in a table but there is yet another wonderful thing you can do with the <div> tag.

You specify a space that your content will fit into and tell it to automatically overflow. It places in scrollbar in the area of that spcified space if it does overflow. So putting it in a table cell it has the effect I needed.

Here's the code:

Code: Select all

<div style="overflow:auto; width:330px; height:360px;">
Content here
</div>
Thanks anyway

Posted: Fri Mar 26, 2004 4:32 pm
by tim
heh, nifty.

:lol: