Wandering Thoughts archives

2007-04-16

Using CSS instead of tables is still using a hack

It's an article of faith in modern web page creation that using tables for layout, especially column-based layout, is an evil hack and that using CSS instead is virtuous, proper, and accessible. (These people probably turn up their noses at WanderingThoughts' table-based layout, which has its reasons.)

I have news for these people: it isn't so. Using CSS floats for layout is still using a hack. In fact, it's using a worse hack; at least tables make it clear what's going on. With CSS, there are two problems: first, CSS is an assembly language to start with, and second CSS creates columns only through indirect implication, which has various problems.

(You don't actually create columns in CSS; you create enough constraints that the browser theoretically has no choice but to put your content into columns. If you miss a constraint, some of your content stages a great escape.)

Thus, the net result of moving from a table based column layout to a CSS based one is replacing a clear hack with an indirect and opaque one.

How about accessibility, one of those claimed benefits? As far as I can see, there are two problems with that idea:

  • basic table based column layouts are common enough that any accessibility technology that wants to be usable in the real world already handles them.
  • because the CSS involved is indirect and opaque, it's almost certainly harder for accessibility technology to work out that your stuff is in a multi-column layout and what's in what column.

(In any case, per here, the most important thing for screen readers and the like is to put the important content first in your HTML and the boring navigation afterwards.)

For more reading on this, start with Aristotle Pagaltzis and follow his links.

web/CSSvsTables written at 22:45:00; Add Comment


Page tools: See As Normal.
Search:
Login: Password:
Atom Syndication: Recent Pages, Recent Comments.

This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.