Whilst writing the article on scientific publishing with XHTML and CSS, I needed a way to automatically number tables and figures. Using CSS counters and generated content this proved to be easily possible.
As an additional bonus it is further possible to create auto-generated captions for tables and images, by extracting the information from the title
and summary
attribute on the table. By then applying display:table-caption;
the information is positioned as a caption on the table. This provides a minimal markup and interesting use of the semantic properties of the attributes.
This technique has already been put to practical use in, for example, my Opera 8 tutorial where the alt
-information of the images is used as caption, by positioning it with respect to the image.
© 2003-2006, Mark Schenk.