表格中的colspan colspan

swiftwwj 2019-12-06

colspan  属性规定单元格可横跨的列数 colspan="2"

rowspan 属性规定单元格可横跨的行数 rowspan="2"

<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Demo</title>
</head>

<body>
  
    <section>
        <h1>表格</h1>
        <table border="1">
            <thead>
                <tr>
                    <th>表头1</th>
                    <th>表头2</th>
                    <th>表头3</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                    <td>数据1</td>
                    <td>数据2</td>
                    <td>数据3</td>
                </tr>
                <tr>
                    <td colspan="2">数据colspan可横跨的列数1</td>
                    <td>数据3</td>
                </tr>
                <tr>
                    <td rowspan="2">数据rowspan可横跨的行数1</td>
                    <td>数据2</td>
                    <td>数据3</td>
                </tr>
                <tr>
                    <td>数据2</td>
                    <td>数据3</td>
                </tr>
            </tbody>
        </table>
    </section>
   
</body>

</html>

表格中的colspan  colspan

相关推荐

pythonclass / 0评论 2019-12-29