Friday, February 19, 2010

100% table height

It is a very common problem to designers/developers that the table height doesnt expand to 100% of the space even if they set it in the style.

If you are trying to set 100% height of the table directly contained the body of a html page the you need to first set the height of the body and html. The below code will work perfectly fine for the 100% table height.
<html style="height: 100%;"><body style="height: 100%;"><table style="height: 100%;"> <tr> <td>....</td> </tr></table></body></html>

if you are using css, then..
html, body
{
height: 100%;
}