So far we have talked only about tables with a cell at the intersection of each row and column. In the real world, though, we often need to span cells, that is, to combine two or more cells into a larger area that holds a single item.
Here is the procedure for column spanning, where multiple cells of the same row are combined.
To each colspec element, add a colname attribute that specifies a unique
name for that column.
Inside the entry element to be
spanned, add two attributes. Set the namest attribute value to the name of the column where the
spanning is to start. Set the nameend
attribute value to the name of the ending column.
Here is a small table that demonstrates spanning. Note that the last two column headings are each centered over two columns:
Table 2. Rising and setting of Venus, 1994
| 20° N. Lat. | 30° N. Lat. | ||||
|---|---|---|---|---|---|
| Rise | Set | Rise | Set | ||
| Jan. | 1 | 6:21 | 17:14 | 6:43 | 16:52 |
| 11 | 6:35 | 17:31 | 6:56 | 17:10 | |
Here's the source for the first part of this table:
<table id='venus-table'>
<title>Rising and setting of Venus, 1994</title>
<tgroup cols="6" align="right">
<colspec align="left" colname="month"/>
<colspec colwidth="4em" colname="day"/>
<colspec colwidth="3em" colname="rise-20"/>
<colspec colwidth="5em" colname="set-20"/>
<colspec colwidth="5em" colname="rise-30"/>
<colspec colwidth="5em" colname="set-30"/>
<thead>
<row>
<entry namest="month" nameend="day"/>
<entry namest="rise-20" nameend="set-20" align="center">
20° N. Lat.
</entry>
<entry namest="rise-30" nameend="set-30" align="center">
30° N. Lat.
</entry>
</row>
<row>
<entry namest="month" nameend="day"/>
<entry>Rise</entry>
<entry>Set</entry>
<entry>Rise</entry>
<entry>Set</entry>
</row>
</thead>
<tbody>
<row>
<entry>Jan.</entry>
<entry>1</entry>
<entry>6:21</entry>
<entry>17:14</entry>
<entry>6:43</entry>
<entry>16:52</entry>
</row>
...