Wednesday, April 11, 2007

Aligning Tabular Data

The TABLE Tag in HTML exists to support tabular data.

Here is a question for any accountants out there: What is the one formatting thing that you want to do with columns of numbers?


You want to either right align (or preferably decimal align) rows of numbers.

The standard of right aligning columns of numbers and left aligning text reaches way back to the invention of the Arabic numeral system.

The HTML language includes a COL tag. Internet Explorer will align columns specified with the col tag. FireFox and standard compliant browsers do not.

I understand that the reason that the COL tag does not work in FireFox is that cells in the row do not inherit the properties of the column. I guess the ideal of the HTML standards is that everything in XML languages need to be based on a hierarchical model. A tag can only inherit properties when it is nested in other tags. Since an HTML file really is just a one dimensional string. In the 1 dimensional hierarchical world of the standards committees, only the rows can inherit properties.

Tables are two dimensional.

The simple one dimensional hierarchical method that bureaucrats love fails when more than one dimension is involved. With a one dimensional model, you can either inherit the columns or you could inherit the rows, but not both.

The sad thing, of course, is that HTML is primarily about displaying information on a two dimensional surface.

Tables are an inherently two dimensional structure. Rene Descartes showed us that we can do all sorts of wonderful things with very simple two dimensional mathematics.

The reason that web masters were drawn to TABLEs like flies was because it gives them a two dimensional framework for their designs.

Creating a program that allows formatting of both tables and columns is really not that difficult.

It leaves me wondering why the standards committees are forcing so much brain damage on the world in their pursuit of the idiotic ideal of trying to force inherently multidimensional structures into one dimensional hierarchical models?

In order to do the really simple task of aligning a column, I have to set a style tag on each cell in the column I want to align ( style="text-align: right" ).

Here is a Webmaster World Thread lamenting the same lack of thought on the part of the W3.

No comments: