How to have table span the entire height?

Posted by Yogendra on Stack Overflow See other posts from Stack Overflow or by Yogendra
Published on 2011-01-02T20:04:09Z Indexed on 2011/01/02 20:53 UTC
Read the original article Hit count: 185

Filed under:
|

Hi All,

I have a html table and I am trying to have it span the entire page height. For some reason I am not able to get this to work. I have set the html, body and table height to be 100%, but the table still does not occupy the entire 100%.

Heres the code. It is very basic because I am just trying to have the table occupy the entire height.

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.WebForm1" %>

<style type="text/css">
    body,html 
  {    
      margin:0;    
      padding:0;   
      height:100%;
  }
</style>

<table border="2" cellpadding="0" cellspacing="0" style="height:100%; width:100%" >
    <tr>
        <td>ABCD</td>
    </tr>
</table>

</form>

I tried for couple of hours and I could not get it to work. Any help is really appreciated.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about html