No replies
Last seen: 18 years 15 weeks ago
Joined: 2003-10-11
Posts: 5
Points: 0

I have a div which contains a table with some rows of data.

These rows are generated dynamic and so the rows can be 1 or more than 1.

Requirement: The div should display maximum 10 rows at once after which there should be a vertical scrollbar in the div to scroll the table inside it. But when the rows is less than 10, the height of the div should be adjusted accordingly i.e it shouldnt take the space of 10 rows.

What I have tried: Giving a fix height ex. 200px to the div with overflow: auto. But if I use this and if I have date less than 200p, it still leaves 200px gap at the bottom.

Can someone please provide a solution to this.