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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Element Width in IE

Status
Not open for further replies.

ID10T16

Technical User
Sep 22, 2000
160
US
Is it at all possible to gather the element width in IE 6?

I've tried clientWidth, width, and offsetWidth.

They either give me a 0 or nothing at all.

I either need to find the width of the primary table, or the width of a div in the table, but cannot find out how to do it.

Does anyone have any idea how to do this?
 
well, one example would be:

document.getElementById('bodyFF').offsetWidth;

This yields a value of 0.

other unsuccesful methods were (bear in mind some of these were merely flayling arms and hoping to hit something that might accidentally work):

document.getElementById('bodyFF').style.width;
document.getElementById('bodyFF').width;
document.getElementById('bodyFF').style.offsetWidth;


Some of these worked in FF, but none work in IE.

I just need to find a way to determine the width of an element that is NOT static. IE grows the element to fit the content, but it apparently wants to keep the actual size a secret.




 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top