Reputation: 27021
I have a table which has a caption which appears on top of the table.
I'd need another caption to appear at the bottom of the table. how would it be possible?
<table>
<caption>My Table - Start</caption>
<tbody></tbody>
<tfooter></tfooter>
<caption>My Table - End</caption>
</table>
Upvotes: 6
Views: 7361
Reputation: 3032
You should put the <caption> at the top of the table, right below the <table> tag. Then you can use the CSS:
caption {
caption-side: bottom;
}
to get it below the table. And only one caption per table as a previous person wrote. If you need a table title, then either use <th> or put a heading outside the table and use CSS to position it correctly.
Upvotes: 10
Reputation: 1948
I believe you can only have 1 caption per table and it must appear after the table tag. You could add a div right after the table and put your caption there.
Upvotes: 1
Reputation: 14501
You could mock one by doing the following, and applying some CSS
<table>
<caption class="cap">some caption text</caption>
<tr>
<td>cell 1</td><td>cell 2</td><td>cell3</td>
</tr>
<tr>
<td>cell 1</td><td>cell 2</td><td>cell3</td>
</tr>
<tr>
<td>cell 1</td><td>cell 2</td><td>cell3</td>
</tr>
<tr>
<td colspan="3" class="cap foot">
This is pretty much a footer caption.
</td>
</tr>
</table>
Upvotes: 1