[css]table的拆分

https://blog.csdn.net/qq_35415600/article/details/70237433

<body>
<table border="1" cellspacing="0">
    <tr>
        <td>ip</td>
        <td>host</td>
        <td>task</td>
        <td>item1</td>
        <td>item2</td>
        <td>item3</td>
    </tr>
    <tr>
        <td rowspan="4">1</td>
        <td rowspan="4">2</td>
        <td rowspan="4">3</td>
        <td rowspan="4">4</td>
        <td rowspan="4">5</td>
        <td>6</td>
    </tr>
    <tr>
        <td>6</td>
    </tr>
    <tr>
        <td>6</td>
    </tr>
    <tr>
        <td>6</td>
    </tr>
</table>
<hr>


<table border="1" cellspacing="0" width="50%" height="150">
    <caption>纵向合并单元格</caption>
    <tr>
        <th>班级</th>
        <th>姓名</th>
        <th>姓名</th>
        <th>年龄</th>
        <th>电话</th>
    </tr>
    <tr>
        <td rowspan="2">601班</td>
        <td rowspan="2">601班</td>
        <td>Jack</td>
        <td>24</td>
        <td>1351234567</td>
    </tr>
    <tr>
        <td>Tom</td>
        <td>22</td>
        <td>1351234567</td>
    </tr>
    <!--rowspan中必须指定要合并的列数目,是两行还是三行等等-->
    <tr>
        <td rowspan="3">602班</td>
        <td rowspan="3">602班</td>
        <td>Rose</td>
        <td>22</td>
        <td>1351234567</td>
    </tr>
    <tr>
        <td>张三</td>
        <td>25</td>
        <td>1351234567</td>
    </tr>
    <tr>
        <td>李四</td>
        <td>25</td>
        <td>1351234567</td>
    </tr>
</table>

posted @ 2018-08-10 09:49  mmaotai  阅读(644)  评论(0编辑  收藏  举报