Wrox Home  
Search P2P Archive for: Go

  Return to Index  

html_code_clinic thread: Calculate height of dynamic table


Message #1 by "Jeremy Wise" <jwise@p...> on Tue, 21 Aug 2001 19:12:17
<html>
<head>
<script language="javascript">
function calcheight()
{
	document.all.ourSpan.innerText = document.all.ourTable.height;
}
</script>
</head>
<body onLoad="calcheight();">
	<table id="ourTable" border="1">
		<tr><td>foo</td><td>bar</td></tr>
		<tr><td>baz</td><td>zot</td></tr>
	</table>
	<br>
	Height: <span id="ourSpan">?</span><br>
</body>
</html>

Is there any way to determine the height of this table without setting a 
height="xx" in the <table> tag?  I want to generate a table and then find 
out how many pixels tall it is.  Can I do this with JS/HTML/DHTML/etc?

Thanks!

  Return to Index