Email conversation
From | Michael H. |
To | Me |
Subject | Re: height of a td element |
Date | 29 May 2003 22:23 |
I enjoyed your "new" site and all the nifty features and scripts ... but
for the life of me I can't seem to find a way on the net of how to capture
the height of a fomated table td with any js concepts, even nodes and
element calls. Basically all I'm trying to do is create two side-by-side
td columns, but make them equal to each other in height based on the
deepest one (perhaps using a 1px wide by x-px high clear image in the
shorter one. But I have to have something to define that height with.
Is there anyway to capture that td height information within a written td
cell after the page has loaded? I even tried placing that td inside a
<div> tag, but with no luck. Any help you could offer would be greatly
appreciated. Thanks.
--Michael
There is no cross browser way to do what you want (layers browsers like
Netscape 4 do not provide information like that - but they are on the way
out, so I don't particularly care). However, most DOM and proprietary DOM
browsers allow you to work out the size of any HTML element using its
offset properties. This will include IE4+, Opera 5+, Netscape6+,
Konqueror, Safari, ICEbrowser, iCab etc. See the attached script.
Hope this helps
Tarquin
author
http://www.howtocreate.co.uk
From | Michael H. |
To | Me |
Subject | Re: height of a td element |
Date | 30 May 2003 16:21 |
Actually, the cross-browser part is no problem at all, as I'm only working
on an admin control panel for our site that will exclusively use IE. Any
chance you could supply me with a tiny example of how to get the td height
with js for IE? That would be so terrific. I could even give you an
"honorable mention" in the contributions part of the (private) extranet cp
utility. Thanks again.
--Michael
From | Me |
To | Michael H. |
Subject | Re: height of a td element |
Date | 30 May 2003 19:06 |
the file I attached to the last email does it all for you, including IE:
the quickest way (for just IE) is:
document.all['idOfTheTD'].offsetHeight
From | Michael H. |
To | Me |
Subject | Re: height of a td element (Ooops) |
Date | 31 May 2003 09:30 AM |
Sorry, Mark, I completely missed the attatchment you sent earlier ... but i
got it now. Thanks again. Looks great, can't wait to try it later today.
--Michael