Reputation: 125
<div style='width: 240px; height:530px; overflow:scroll;'>
<table>
bla.. bla..
</table>
</div>
Dear all, I want to set this div height automatically, but when I change this into height:auto; the data in table cannot be scroll.
Anyone have a suggestions ?
Thank you.
Upvotes: 5
Views: 20295
Reputation: 797
<div style='width: 240px; height:530px; overflow-y: auto;'>
<table>
bla.. bla..
</table>
</div>
We can use other option overflow: auto; if we want both scroll bar X And Y
Upvotes: 1
Reputation: 6656
<div style='width: 240px; min-height:530px; overflow:scroll;'>
<table>
bla.. bla..
</table>
</div>
Upvotes: 3
Reputation: 4210
You can use set min-height and max-height, so if it exceeds the max-height the scroll will be displayed
Upvotes: 2