Wednesday, September 18, 2002

Working on the Table Chapter for the Book
After putting the kids to bed, I've been spending much of my evenings this past week working on the chapter devoted to CSS table properties.

Oddly enough it's one of those few areas that has yet to be touched by the CSS3 revisions. Maybe not so surprising, since it is really dealing with such a limited set of properties, which for the most part the browser manufacturers don't seem to have placed much priority on implementing.

These properties, like empty-cell, border-spacing, caption-side and so on are there primarily to do minor formatting jobs on existing HTML tables. Nothing drastic, or even things people are likely to use that often, and for the most part seem to be there to tidy up some loose ends with current HTML formatting. The current CSS2-based specification doesn't really have anything to do with coming up with alternate ways of arranging tables via CSS, as that's what the CSS3 multicolumn module is intended for, but still, it has to rank as one of the lamest of the CSS2 sets of properties.

In order to liven things up, I've decided to add a section to this chapter one how to accomplish table-like layout using CSS, as I figure that this is a natural "fit" for this chapter. The real trick has to do with browser compatibility, as the IE 5.x PC box model is screwy, placing such things as borders within (instead of outside) a specified box. I discovered some very cool tricks, including an apparently well-known parsing bug in IE 5.x PC that allows better-compliant browsers to do the job they need to do while giving IE 5.x PC what it needs to render things properly.

I ended up taking the code from this place and started playing with it, coming up with a modular two-column and three-column layout, which on the whole I think works and looks better than the originals. There's still some real problems with this sort of layout though -- if you have some <pre>-based content using large words, it will overflow into the next column. Ugh. And this is besides the obvious browser compatibility problems -- there's still a substantial number of people using Netscape Navigator 4.x, to whom this layout code simply doesn't work. Still, CSS formatting is the way to go -- though I think the CS3 multicolumn spec will end up being the preferred way to go in the long run.

Ordinarily I'd show off my sample code, but I ended up writing things up as a story for the next issue of The Computer Paper, so it'll have to wait until that article is published. ;-)


This page is powered by Blogger. Isn't yours?

Subscribe to Posts [Atom]