|
-
July 24th, 2005, 02:07 AM
#1
Get document's/table's real size using JS
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
Last edited by druven; July 24th, 2005 at 03:00 AM.
-
July 25th, 2005, 10:13 PM
#2
Re: Get document's/table's real size using JS
If it was not specified in the parameters of the <table> tag, then it cannot be done.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|