<caption>
Summary
The <caption> element provides information about a table.
If a table includes a caption, it must be the first child element of table.
Usage context
| Element category | table |
|---|---|
| PSML level | portable |
| Permitted content | text and character-style elements |
| Permitted parent | <table> |
| HTML equivalent | <caption> |
| OpenXML equivalent | <w:tblCaption> |
Attributes
This element does not have any attributes.
Examples
Table with a caption
<table>
<caption>Average scores</caption>
<row part="header">
<cell>Name</cell>
<cell>Score</cell>
</row>
<row>
<cell>Alice</cell>
<cell>17</cell>
</row>
<row>
<cell>Bob</cell>
<cell>19</cell>
</row>
</table>
This would be generally be represented in HTML as:
<table>
<caption>Average scores</caption>
<thead>
<tr>
<th>Name</th>
<th>Score</th>
</tr>
</thead>
<tbody>
<tr>
<td>Alice</td>
<td>17</td>
</tr>
<tr>
<td>Bob</td>
<td>19</td>
</tr>
</tbody>
</table>
And would render as:
| Name | Score |
|---|---|
| Alice | 17 |
| Bob | 19 |
Schema
XML Schema
<xs:element name="caption" type="character-style"/>
Relax Schema
element caption { character-style }
Compatibility
This element was introduced in the first draft of PSML and is well-supported from PageSeeder 5.1.
The PSML caption supports rich text (such as character-style elements), however, the OfficeOpenXML equivalent <w:tblCaption> does not.