Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Work about the height of the visible screen

Status
Not open for further replies.

gameon

Programmer
Feb 23, 2001
325
GB
Hi, is there a way to work out the height of the visible area of the browser window, then make a table that heigh, rather than using height="100%"?

Cheers,

M@
 
Hi have tried this, but it does not take the browser components into consideration...

<script language=&quot;JavaScript&quot;>
document.write(<table width=&quot;100%&quot; height=&quot;screen.height&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>)</script>

M@
 
<table style=&quot;width: 100%; height: 100%;&quot;>

Hope that helps!

Happy coding! :)
 
Sorry, as I mentioned, I don't want to use 100%, I need to work out what the size of the display area of the browser is...

Thanks for replying though...

M@)
 
<html>
<head>
<title></title>
<script>
onload = function() {
var AvailableWindow = document.body.clientHeight;
document.getElementById(&quot;MyTable&quot;).style.height = (AvailableWindow);
}
</script>
<style>
body
{margin: 0; padding: 0; height:100%;}
</style>
</head>
<body>
<table id=&quot;MyTable&quot; border=&quot;1&quot;>
<tr>
<td></td>
</tr>
</table>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top