Saturday, February 21, 2009

Eric Meyer Smackdown on Return of Table-based CSS Layout

A new book came out just a few months ago titled "Everything You Know about CSS is Wrong". When I first saw this, I wondered if time spent learning layout, floats and ways of the Zen Garden had been a waste of time. The book, by Rachel Andrew and Kevin Yank advocates an approach where you use CSS to impose table-based layout on your HTML document, but without actually using table markup. It doesn't work in IE6 or IE7, but will work in IE8.

CSS Jedi Master Eric Meyer, without naming names, put the smackdown on this approach in a recent blog post:
"And please, let’s put the whole “display: table-cell will grant those abilities through CSS” to rest. Saying that is just saying “use tables for layout” with different words.

Turning a bunch of divs or list items or whatever into table-role boxes is no better than just using table markup in the first place, and it’s arguably worse. Using element names other than table and td to create layout tables, and then claiming it’s not using tables for layout, borders on self-deception.

Not to mention doing things that way means you’re doing your layout in a highly source-order-dependent fashion, which was one of the things about table layout we were trying to get away from in the first place".
Whew... what a relief.

Post a Comment

Note: Only a member of this blog may post a comment.