阅读(1657)

HTML 表标题

最后一次修改 2017年08月03日

HTML表格标题


caption 元素允许您定义一个标题并将其与table元素相关联。

align 属性已过时。

例子

以下代码显示了正在使用的caption元素。

<!DOCTYPE HTML><html><head></head><body>
  <table>
    <caption>Results of the Survey</caption>
    <tbody>
      <tr>
        <th>Favorite:</th>
        <td>500</td>
      </tr>
    </tbody>
  </table></body></html>

表只能包含一个 caption 元素,但不一定是表中包含的第一个元素。