html_table表格

## `table`表格

表格的常用标签

- `table`表格
- `thead`表格头
- `tbody`表格主体
- `tfoot`表格尾
- `th`元素定义表头单元格
- `tr`定义表格行
- `td`元素定义内容单元格
- `caption`表格标题
- `rowspan`合并行
- `colspan`合并列

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>table</title>
    <style>
        /*合并表格单元格之间的空隙*/
        table{
            border-collapse: collapse;
            width: 300px;
            height: 150px;
        }
        /*文字水平居中*/
        tr{
            text-align: center;
        }
    </style>
<body>
    <table border="1">
        <caption>
            <strong>加粗表的名字</strong>
        </caption>
        <thead>
            <tr>
                <th>班级</th>
                <th>人数</th>
                <th>爱好</th>
            </tr>
        </thead>
        <tbody>
            <tr id="first">
                <td rowspan="2">合并2行</td>
                <td colspan="2">合并2列</td>
                <td>3</td>
        </tbody>
    </table>
</body>
</html>
原文地址:https://www.cnblogs.com/tangpg/p/8267761.html