Scrollbars in table

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Scrollbars in table

Post 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
User avatar
PrObLeM
Forum Contributor
Posts: 418
Joined: Sun Mar 07, 2004 2:30 pm
Location: Mesa, AZ
Contact:

Post 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
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post 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
User avatar
tim
DevNet Resident
Posts: 1165
Joined: Thu Feb 12, 2004 7:19 pm
Location: ohio

Post by tim »

heh, nifty.

:lol:
Post Reply