Next / Previous / Contents / Shipman's homepage

12.5. Vertical (row) spanning in tables

You can also make a cell span multiple rows vertically. To do this:

  1. Inside the cell's entry element, add an attribute morerows='N', where N is the number of additional rows to be spanned. For example, an attribute of morerows='2' would create a cell that spans three rows.

  2. Wherever a cell is vertically spanned, omit the entry elements from the rows into which it is spanned. For example, if the cell in column 1 of row 1 spans three rows, omit the entry element for column 1 in rows 2 and 3.

Here is our Venus table rearranged to demonstrate vertical spanning:

Table 3. Rising and setting of Venus, 1994

MonthDay 20° N. Lat. 30° N. Lat.
RiseSetRiseSet
Jan.16:2117:146:4316:52
 116:3517:316:5617:10

Here is the thead section of the modified table; the rest of the table is as described in Section 12.4, “Horizontal (column) spanning in tables”.

          <thead>
            <row>
              <entry morerows='1' valign='bottom'>Month</entry>
              <entry morerows='1' valign='bottom'>Day</entry>
              <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>Rise</entry>
              <entry>Set</entry>
              <entry>Rise</entry>
              <entry>Set</entry>
            </row>
          </thead>

Although the table has six columns, the second row in the thead element has only the four cells for columns 3-6, because columns 1 and 2 in those rows are occupied by the vertically spanned cells from the previous row.

You can combine vertical and horizontal spanning. If you do, the spanned cell will always occupy a rectangular block of the table. For example, if the cell in row 15, column 3, spans four columns and two rows, it will occupy columns 3–6 of rows 15–16.