Home  >  Article  >  Web Front-end  >  The basic composition of table in html

The basic composition of table in html

下次还敢
下次还敢Original
2024-04-27 20:46:491167browse

HTML表格的基本组成:: 表格标题或摘要: 表格标题行: 表格数据行主体: 表格脚注行: 一行表格数据: 表头单元格: 数据单元格

The basic composition of table in html

HTML 中表格的基本组成

表格 (table) 元素是 HTML 中用于创建表格数据的元素。它由几个基本组成部分组成:

元素:

  • 定义表格的标题或摘要。
  • 位于 元素的第一层。

    元素:

    • 定义表格的标题行。
    • 包含
    元素,其中包含表头 (元素:

    • 定义表格的数据行主体。
    • 包含
    元素,其中包含表格数据 (元素:

    • 定义表格的脚注行。
    • 包含
    元素,其中包含表格汇总或注释数据。

    元素:

    • 定义一行表格数据。
    • 包含
    ) 数据。

    ) 数据。

    (表头)或 (数据)元素。

    元素:

    • 定义表头数据单元格。
    • 通常居中对齐并加粗显示。

    元素:

    • 定义数据单元格。
    • 可以包含文本、数字、图像或其他 HTML 元素。

    示例:

    <code class="html"><table>
      <caption>员工信息</caption>
      <thead>
        <tr>
          <th>姓名</th>
          <th>职务</th>
          <th>薪水</th>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>约翰·史密斯</td>
          <td>经理</td>
          <td>$50,000</td>
        </tr>
        <tr>
          <td>玛丽·安</td>
          <td>工程师</td>
          <td>$40,000</td>
        </tr>
      </tbody>
    </table></code>

    The above is the detailed content of The basic composition of table in html. For more information, please follow other related articles on the PHP Chinese website!

    Statement:
    The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn