HTML+ Tables

I started by looking at how existing packages like tbl, LaTeX and Microsoft Word handle tables. My initial thoughts were to allow authors to specify the column widths and alignments via an attribute on the <table> element. It eventually became clear that it would be better to leave this to the browser to work out by itself.

The adopted model treats the table as a sequence of rows, each of which contains one or more cells. The cells in turn are differentiated into header and data cells. This allows browsers to change the default fonts, borders and colors to distinguish headers from data. Cells can be merged with their neighbours to create larger cells.

Browsers use two passes through each table's markup to count the number of columns and find the min/max widths needed for each cell. This is used to allocate the column widths prior to the second pass. Any spare room is shared out in proportion to the difference between min and max requirements for each column.

If your browser supports HTML+ click here.

Simple table A simple example.

More complex table A more complex example

Tables can be used to control layout
Layout example