Safari is returning the wrong width value

2.3k Views Asked by At

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

3

There are 3 best solutions below

0
On BEST ANSWER

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

1
On

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.

0
On

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