table tag height=100% is not working

liunx

Guest
Hi all, <br />
I thought i knew HTML (atleast to make simple webpages). But this code making me so angry. A simple tag <table width="100%" height="100%"> ....Width 100% is working...but the height, its not working. What am I doing wrong? Please help asap. <br />
<br />
Thanks<!--content-->Using height 100% will only make the table only as high as the content that is within the table.<!--content--><html><br />
<script type="text/javascript"><br />
//<![CDATA[<br />
<br />
function sizeContent(){<br />
var tbl=document.getElementById("parentTable");<br />
if(navigator.userAgent.match("Gecko")){<br />
var bHeight=window.innerHeight;<br />
}else{<br />
var bHeight=document.body.clientHeight;<br />
}<br />
<br />
document.getElementById("parentTable").style.height=bHeight+"px";<br />
}<br />
<br />
//]]><br />
</script><br />
<br />
<body onload="sizeContent()"><br />
<table id="parentTable" cellpadding="0" cellspacing="0" width="100%" border="1"><br />
<tr><br />
<td>some content</td><br />
</tr><br />
</table><br />
</body><br />
</html><!--content-->
 
Back
Top