Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Scrollable table

 
m avalla
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you create a scrollable table using HTML?
Thanks!
 
Adithya Rayaprolu
Ranch Hand
Posts: 137
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using Div tag, style overflow, you can create scrollable table.
<div style="overflow:X:auto; width: 200px;">
<table.....></table>
</div>
The above code will generate a table which scroll horizontally, not vertically.
<div style="overflow:auto; width:200px; height:300px"><table...></table>
</div>
This code will generate both vertically and horizontally scrollable table. If you want the scrollbars to appear all the time, just use overflow:scroll. overflow:auto will generate scroll bars only when needed. If the table width and height are within those specified by div tag, you will not get scrollbars.
HTH.
 
Rob Hunter
Ranch Hand
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you always display just the vertical scrollbar (overflow:X:scroll)?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
overflow-x: scroll

that is IE only

Eric
 
Rob Hunter
Ranch Hand
Posts: 832
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
overflow-x is IE only or overflow in general is? Thanks.

Rob
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
overflow-x and overflow-y are IE only
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic