I just read codes of a web product that is supposed to support multiple modern browser(including FireFox 3.X, Safari 3.X and IE7+, but not including IE6-). The HTML code uses div instead of table to create table-like effects. Actually, the div's are organized like this:
<div>
<div>
<div style="float:left" id="header1">...</div>
<div style="float:left">...</div>
<div style="float:left">...</div>
</div>
<div>
<div style="float:left" id="header2">...</div>
<div style="float:left">...</div>
<div style="float:left">...</div>
</div>
There is a piece of onload JavaScript code to read all "headerX" elements, calculate their max offsetWidth. Then assign the max offsetWidth to each of them. In this way, the div is well aligned to be like table.
Actually, I don't think this is a good way to go, but I'm told that the product is designed this way to make it cross-browser supported, because table behaves different in different browsers.
I'm not convinced. So, the question. Besides the approach mentioned above, is there any better to make table-like layout for all popular browsers?