Hi I have a table with a div in it the table has 2 columns and both are 50% In most browsers I can use offsetWidth to get the width of the article. But in Safari the width is less or more than what it should be. Any help would be greatly appriciated. Regards Richard
Asked
Active
Viewed 2,151 times
0
-
Could you post here code for these elements? – pepkin88 Sep 13 '10 at 16:30
3 Answers
0
offsetWidth
is not a standardized value across browsers. It may or may not include the scroll-bar width. You may get more consistent figures from clientWidth
which tends to exclude margins, borders and scrollbars.

Isaac Lubow
- 3,557
- 5
- 37
- 53
-
According to this http://www.quirksmode.org/dom/w3c_cssom.html it seems not to be the issue. – pepkin88 Sep 13 '10 at 16:27
0
Maybe the value of offsetWidth is gathered in different time that in other browsers. Try calling it in onload or ondomready event.

pepkin88
- 2,742
- 20
- 19