get the size of a table or cell

C

chris

is there a way by using html or javascript or anything else for that matter
to detirmine the actual height or width of a table or cell

for example if i only set the height to 100 and the data in the cell needs a
higher cell it expands to suit - i want to find out what the actual height
ends up ??

thanks for your help

chris
 
W

Will Gittoes

chris said:
is there a way by using html or javascript or anything else for that matter
to detirmine the actual height or width of a table or cell

for example if i only set the height to 100

Make sure you tell it if this is 100 PIXELS (px), PERCENT (%) etc...
This is important!

and the data in the cell needs a
higher cell it expands to suit - i want to find out what the actual height
ends up ??

thanks for your help

chris

No, not that I know of, sorry. Annoying, isn't it?

Just work around it; use good code, learn CSS (http://www.webmonkey.com)
and you can have per-pixel accuracy over your pages anyway.
 
N

noone

Will Gittoes said:
Make sure you tell it if this is 100 PIXELS (px), PERCENT (%) etc...
This is important!

and the data in the cell needs a

No, not that I know of, sorry. Annoying, isn't it?

Actually, if you can set a property, then you can also read a property.
Anything else wouldn't make much sense.

Robert
 
W

Will Gittoes

noone said:
Actually, if you can set a property, then you can also read a property.
Anything else wouldn't make much sense.

Robert

But that merely reads back the property you set!

If you did something in Javascript such as:
element_name = document.getElementById("ElementName");
element_name.style.height="50px"

If you then do this:
alert(element_name.style.height);
You will get 50px - no matter WHAT size it has actually been rendered
(i.e. not taking into account a giant image in the element etc.).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,477
Members
44,898
Latest member
BlairH7607

Latest Threads

Top