Blogger Information
Blog 63
fans 1
comment 0
visits 76086
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
表格的跨行合并、跨列合并
桃儿的博客
Original
1968 people have browsed it

要用到rowspan跨列合并,colspan跨行合并

实例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>表格的跨行和跨列合并</title>
</head>
<body>
<table border="1" cellspacing="0" cellpadding="5" align="center">
    <caption style="color:red;font-size: 30px;">购物车</caption>
    <thead>
    <tr bgcolor="aqua">
        <th>编号</th>
        <th>名称</th>
        <th>单价</th>
        <th>数量</th>
        <th>金额</th>
        <th>备注</th>
    </tr>
    </thead>
    <tbody align="center">
    <tr>
        <td width="50">1</td>
        <td width="200">有备无患的奔驰专用机油1#</td>
        <td width="70">800</td>
        <td width="50">1</td>
        <td width="100">800</td>
        <td width="100" rowspan="2">缺货</td>
    </tr>
    <tr>
        <td>2</td>
        <td>有备无患的奔驰专用机油2#</td>
        <td>800</td>
        <td>1</td>
        <td>800</td>
    </tr>
    <tr>
        <td>3</td>
        <td>有备无患的奔驰专用机油3#</td>
        <td>800</td>
        <td>1</td>
        <td>800</td>
        <td rowspan="4">有货</td>
    </tr>
    <tr>
        <td>4</td>
        <td>有备无患的奔驰专用机油4#</td>
        <td>800</td>
        <td>1</td>
        <td>800</td>
    </tr>
    <tr>
        <td>5</td>
        <td>有备无患的奔驰专用机油5#</td>
        <td>800</td>
        <td>1</td>
        <td>800</td>
    </tr>
    <tr>
        <td>6</td>
        <td>有备无患的奔驰专用机油6#</td>
        <td>800</td>
        <td>1</td>
        <td>800</td>
    </tr>
    </tbody>
    <tfoot align="center">
    <tr>
        <td colspan="3">合计:</td>
        <td>6</td>
        <td>4800</td>
        <td>金额超10000可打9折</td>
    </tr>
    </tfoot>
</table>

</body>
</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例


Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post