我有一张桌子,上面有一个标题。
我需要另一个标题出现在表格的底部。怎么可能?
<table>
<caption>My Table - Start</caption>
<tbody></tbody>
<tfooter></tfooter>
<caption>My Table - End</caption>
</table>
我有一张桌子,上面有一个标题。
我需要另一个标题出现在表格的底部。怎么可能?
<table>
<caption>My Table - Start</caption>
<tbody></tbody>
<tfooter></tfooter>
<caption>My Table - End</caption>
</table>
您可以通过执行以下操作来模拟一个,并应用一些 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>
我相信每个表格只能有 1 个标题,并且它必须出现在表格标记之后。您可以在表格之后添加一个 div 并将您的标题放在那里。
您应该将 <caption> 放在表格顶部,<table> 标签的正下方。然后你可以使用CSS:
标题{标题侧:底部;}
把它放在桌子下面。正如前人所写,每张桌子只有一个标题。如果您需要表格标题,请使用 <th> 或在表格外部放置标题并使用 CSS 正确定位。