Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Determining an "auto" value 2

Status
Not open for further replies.

Quijian

ISP
Jul 9, 2004
32
US
Please forgive me, for I am a major noob. I have a table whose height is set to auto because the content is dynamic. But if height gets too large other tables start to move. Is there any way to determine the value assigned by the browser for the table. I already tried using the document.getElementById('myTable').height way but that just returns a empty variable.
 
Try "clientHeight" or "offsetHeight" instead of "height".

Adam

There's no place like 127.0.0.1
 
Based on some tests I have running, here's the metrics available, and when they can be used:

These will not be set to anything unless they are explicitly set:
style.height:
style.width:
style.left:
style.right:
style.top:
style.bottom:

These will not be set to anything unless the above are explicitly set:
style.pixelHeight: 0
style.pixelWidth: 0
style.pixelLeft: 0
style.pixelRight: 0
style.pixelTop: 0
style.pixelBottom: 0

style.posHeight: 0
style.posWidth: 0
style.posLeft: 0
style.posRight: 0
style.posTop: 0
style.posBottom: 0

These are set only if the attributes on the html tag are set:
height:
width:
left: undefined
top: undefined

These are automatically set by the browser:
offsetHeight: 152
offsetWidth: 302
offsetLeft: 10
offsetTop: 341

clientHeight: 150
clientWidth: 300
clientLeft: 1
clientTop: 1

scrollHeight: 19
scrollWidth: 302
scrollLeft: 0
scrollTop: 0



Tracy Dryden

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top