During the week I read Rachel Andrew and Kevin Yank’s Everything You Know About CSS Is Wrong! At a little over 100 pages it’s a concise explanation of CSS tables and how they will – and an argument why they should – change the way in which web developers work.
EYKACIW! begins by explaining how today’s web developer has hacked CSS to do things it was never designed to do, in much the same way that we hacked HTML tables in the heady days of the 1990s; floats, faux columns, negative margins, positioning, and, several more tricks now used as a second nature all get dishonourable mentions.
I’m not so sure
EYKACIW! points out that there is no CSS table equivalent of the col- and rowspan attributes in an HTML table, a method is detailed in the book to emulate these features with absolute positioning (also available on Kevin Yank’s Sitepoint blog). The method detailed brings to mind the very hacks we’re being discouraged from using.
Another problem I can foresee is that CSS tables will increase, rather than decrease, the amount div bloat required for a typical layout; replacing
<table><tr><td> in an old fashioned HTML table layout with
<div><div><div> – these otherwise redundant divs aren’t necessary for a basic layout, but seem to be inevitable for layouts requiring nested tables.
Hold your horses (and other clich’s)
These are my initial reactions to reading about CSS tables, in some ways it reminds me of my reaction – when learning CSS – to reading that the width of an element doesn’t include the padding or the border; my reaction back then was ‘but that’s stupid’, now it’s just second nature and the concept of including the padding and border is foreign.
EYKACIW! is about CSS tables, with an introduction to other CSS3 layout modules in the final chapter, modules that aren’t implemented in any browser – such as the grid positioning module and the template layout module – these modules excite me, CSS tables seem to require a different set of hacks, and – to paraphrase Regurgitator – I like your old hacks better than your new hacks.
It’s possible that the problem with Everything You Know About CSS Is Wrong! is that it was released too early; maybe it would have been better timed for a couple of years down the track when these new modules are in our browsers; regardless the book will cause a lot of discussion within the developer community about the direction in which CSS3 should go, and that’s only a good thing.