One thing I never liked about HTML tables is that I have to mark both
the beginning and the end of each cell, row, and table. I've never
yet had the need for starting a new cell without closing the previous
one or ending a row without ending the cell. Working with a
typewriter and the TAB key, or with tables in a word processor, I just
go to the next cell, I never have to both exit the current cell and
enter the new one. When I write software that outputs HTML, I always
create the following four functions:
table() emits "<table><tr><td>"
nextcell() emits "</td><td>"
nextrow() emits "</td></tr><tr><td>"
endtable() emits "</td></tr></table>"
Parameters to these functions can set attributes to the emitted tags,
if there is such need.
Most suggestions here repeat the HTML/XML mistake of both opening
and closing each cell and line. What you really need is the above
four primitives. Forget XML. A table could then look like this:
<table> '''Name'''
<tab>'''Instrument'''
<row> Bill Clinton <tab>Saxophone
<row> Louis Armstrong <tab>Trumpet
</table>
Since <table> and </table> are required to match in pairs, you can
even include a table in the cell of another table, if need be.
<table> '''Name'''
<tab>'''Instrument'''
<row> Bill Clinton <tab>Saxophone
<row> Louis Armstrong <tab><table>'''Age'''
<tab>Instrument
<row> 0-3 <tab>Drum
<row> 3-10 <tab>Guitarr
<row> 10- up <tab>Trumpet </table>
</table>
--
Lars Aronsson (lars(a)aronsson.se)
Aronsson Datateknik
Teknikringen 1e, SE-583 30 Linuxköping, Sweden
tel +46-70-7891609
http://aronsson.se/ http://elektrosmog.nu/ http://susning.nu/