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
Scrollbars in table
Moderator: General Moderators
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
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:
Thanks anyway
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>