Lee c.c.
Lee c.c.

Reputation: 69

Fix html table height when gridview inside

I have a gridview inside an html table. I set row height to 30px, but when the content of gridview increases, the row height also expands.

Upvotes: 0

Views: 345

Answers (2)

Lee c.c.
Lee c.c.

Reputation: 69

I had found a way to solve the problem, but it look a bit stupid: I put a 'height="30px"' in every 'td', then it work. I try to put height in 'tr', it didn't work. Please advice me for a better way. Thank you.

Upvotes: 0

Microsoft DN
Microsoft DN

Reputation: 10020

If you want to set fix height of html table whatever is the height of gridview, try wrapping your table inside <div> with overflow:auto;

<div style="height:100px; overflow:auto;">

.... Your table

...

</div>

Upvotes: 2

Related Questions