all
latest

Full post:

Comment feed for this article.


All comments:


Terry Prothero

The methods I have seen so far seem to rely on hacks to function properly in Internet Explorer. I came up up with a surprisingly simple solution that should work with any browser. Rather than choosing between DIV's and Tables, why not use both.

If you create a table consisting of one cell inside of a DIV and use your style sheet to give it a height and width of 100%, you have an interesting new structure that can vertically center text and can float etc. as well. The table stretches to the size of the DIV that contains it, and the overall structure has both table and DIV properties. Best of all, the code is completely legit. No unreliable hacks.



waxpadmin

Terry Prothero - I think you're right on the money as far as sites that don't need to worry about html semantics are concerned.

Hopefully in the future we'll see all browsers implementing 'display: table', 'display: table-cell', etc. so that table alignments can be applied to arbitrary elements just by modding a stylesheet.



Create a new comment: show