跨列

有时你可能需要让表格中的某个单元格跨越多个列。

<!DOCTYPE html>
        <!--
        To change this license header, choose License Headers in Project Properties.
        To change this template file, choose Tools | Templates
        and open the template in the editor.
        -->
        <html>
            <head>
                <title>TODO supply a title</title>
                <meta charset="UTF-8">
                <meta name="viewport" content="width=device-width, initial-scale=1.0">
                        <style>
                    th,td{
                        border: 1px solid red;
                    }
                </style>
            </head>
            <body>
                <div>TODO write content</div>
                <table>
                    <tr>
                        <th></th>
                        <th>第一行</th>
                        <th>第二行</th>
                        <th>第三行</th>
                        <th>第四行</th>
                    </tr>
                    <tr>
                        <th>第一列</th>
                        <td colspan="2">填写的内容</td>
                        <td>填写的内容</td>
                        <td>填写的内容</td>
                    </tr>
                    <tr>
                        <th>第二列</th>
                        <td colspan="3">填写的内容</td>
                        <td>填写的内容</td>
                    </tr>
                </table>
            </body>
        </html>
原文地址:https://www.cnblogs.com/q2546/p/9360870.html