表にすると情報の意味が明瞭になるケースは数多くあります。
表を作成する簡単な方法は、<simplelist> を使った Table 4-1 でも既に紹介しましたが、DocBook には、この種の情報を扱うもっと洗練された方法があります。
Example 4-7. 表の挿入
<table frame="all">
<title>Sample Table</title>
<tgroup cols="5">
<colspec colname="column1">
<colspec colname="column2">
<colspec colname="column3">
<colspec colnum="5" colname="column5">
<spanspec namest="column1" nameend="column2" spanname="span-horiz" align="center">
<spanspec namest="column2" nameend="column3" spanname="span-horiz-vert" align="center">
<thead>
<row>
<entry spanname="span-horiz">
水平方向のスパン
</entry>
<entry>ヘッダ 2</entry>
<entry>ヘッダ 3</entry>
<entry>ヘッダ 4</entry>
</row>
</thead>
<tfoot>
<row>
<entry>フッタ 1</entry>
<entry>フッタ 2</entry>
<entry>フッタ 3</entry>
<entry>フッタ 4</entry>
<entry>フッタ 5</entry>
</row>
</tfoot>
<tbody>
<row>
<entry>データ 1-1</entry>
<entry>データ 1-2</entry>
<entry>データ 1-3</entry>
<entry>データ 1-4</entry>
<entry>データ 1-5</entry>
</row>
<row>
<entry>データ 2-1</entry>
<entry>データ 2-2</entry>
<entry>データ 2-3</entry>
<entry>データ 2-4</entry>
<entry morerows="1" valign="middle">
垂直方向のスパン
</entry>
</row>
<row>
<entry>データ 3-1</entry>
<entry spanname="span-horiz-vert" morerows="1" valign="bottom">
ダブルスパン
</entry>
<entry>データ 3-4</entry>
</row>
<row>
<entry>データ 4-1</entry>
<entry>データ 4-4</entry>
<entry>データ 4-5</entry>
</row>
</tbody>
</tgroup>
</table>
|
Table 4-2. 表の例
| 水平方向のスパン | ヘッダ 2 | ヘッダ 3 | ヘッダ 4 | |
|---|---|---|---|---|
| データ 1-1 | データ 1-2 | データ 1-3 | データ 1-4 | データ 1-5 |
| データ 2-1 | データ 2-2 | データ 2-3 | データ 2-4 | 垂直方向のスパン |
| データ 3-1 | ダブルスパン | データ 3-4 | ||
| データ 4-1 | データ 4-4 | データ 4-5 | ||
| フッタ 1 | フッタ 2 | フッタ 3 | フッタ 4 | フッタ 5 |