views:

21

answers:

3

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

A: 

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
According to this http://www.quirksmode.org/dom/w3c_cssom.html it seems not to be the issue.
pepkin88
A: 

Maybe the value of offsetWidth is gathered in different time that in other browsers. Try calling it in onload or ondomready event.

pepkin88
A: 

Just set the width and height - safari's bug -just accept it.

Richard Housham