Click to See Complete Forum and Search --> : Get document's/table's real size using JS


druven
July 24th, 2005, 02:07 AM
Hi all,
I've created a web page that contains only a table, and I need to get the page's size.

I've tried using document.documentElement.scrollHeight or document.body.scrollHeight but I get the browser's window size and not only body's.

I thought about passing over all the table's TR's and sum all heights and widths. Something like:
table = document.getElementById("tblForm");
for (i=0 ; i<table.numRows ; i++)
height += table.rows[i].height.

for (i=0 ; i<table.numCols ; i++)
width += table.cols[i].width.

Does JavaScript has the properties for doing that, or is there any other way to know the table's/body's size?
Help will be truly appreciated

PeejAvery
July 25th, 2005, 10:13 PM
If it was not specified in the parameters of the <table> tag, then it cannot be done.