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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add Scrollbars in atable?

Status
Not open for further replies.

ashpassword

Programmer
Jun 19, 2002
19
IN
How can I add scrollbars in a table?
So that my contents in it not get disturbed as per the clients machine screen's resolution.
 
wrap it in <DIV> tags as follows:

Code:
<DIV STYLE=&quot;height: 100; overflow: auto;&quot;>
<TABLE>
...table code here

</TABLE>
</DIV>

set the DIV height to whatever you like. If the contents of the table exceed this height then the DIV will show a scrollbar. Tony
 
CSS provides rules that allow you to specify how to deal with overflow of content - including adding scrollbars. Unfortunately, this is not yet supported in the context of tables with current browsers. However, if you set the width of your table explictly, it should stay that size no matter what screen resolution the client has. Then, if it the table is bigger than the client's viewport, the browser would provide scrollbars on the window itself, allowing you to see what is beyond the edges of the viewable area. This &quot;resizing&quot; of the canvas shouldn't affect the flow of other elements on your page.
The property for setting the width of your table is simply 'width=&quot;#&quot;', where # is any positive integer, without units (pixels are the implied unit). You can also use the width property of CSS to achieve the same effect (this one does require units to be specified). -----------------------
*doink!*
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top