PDA

View Full Version : 100% table height


Candrias77
08-21-2002, 02:01 PM
Hi there, i am trying to make a table fit the height of the screen vertically but it does not seem to be working very well. I have heard that IE does not recognise the height=100% table atribute but surely someone has worked out a way to get around this with javascript or something!?

Any tips on getting this working would be much appreciated, thanks.

-Candrias

Spookster
08-21-2002, 03:03 PM
<html>
<head>
<title>Full Height Table</title>
</head>
<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0">
<script lanaguage="Javascript">
<!--//
var IE5up = document.getElementById&&document.all;
var NS6up = document.getElementById&&!document.all;
var NS4 = document.layers;
var IE4 = document.all&&!window.print;
if(NS4||NS6up)
h=window.innerHeight;
else
h=document.body.clientHeight;

//THIS IS THE START OF YOUR TABLE
document.write('<table bgcolor="orange" border="1" width="100%" height="'+h+'">');

document.close();
//-->
</script>
<noscript>
<!-- THIS IS FOR NONJAVASCRIPT ENABLED BROWSERS -->
<table border="1" height="100%">
</noscript>

<tr><td>
<h1>Some Text</h1>
</td></tr>
</table>
</body>

</html>