Blogger Information
Blog 13
fans 0
comment 0
visits 10461
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
完成表格的跨行合并功能
PHPer博客
Original
1060 people have browsed it

实例

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>完成表格的跨行合并功能</title>
</head>
<body>
<!--用表格来写一个购物车-->
<table border="1" cellspacing="0" cellpadding="5" width="590">
    <!--    标题-->
    <caption>购物车</caption>
    <!--    表头-->
    <thead>
    <!--    单元格宽度设在表头和表格主体都行-->
    <tr bgcolor="#add8e6">
        <th width="50">编号</th>
        <th width="200">名称</th>
        <th width="70">单价</th>
        <th width="50">数量</th>
        <th width="80">金额</th>
        <th width="80">分类</th>
    </tr>
    </thead>

    <!--    表格主体-->
    <tbody>
    <tr>
        <td >1</td>
        <td >有备无患的奔驰专用机油</td>
        <td >800</td>
        <td >1</td>
        <td >800</td>
        <td >汽车用品</td>
    </tr>
    <tr>
        <td>2</td>
        <td>能看清鞋子的京东摄像头</td>
        <td>150</td>
        <td>2</td>
        <td>300</td>
        <td rowspan="2">电子数码</td>
    </tr>
    <tr>
        <td>3</td>
        <td>带暖手宝功能的笔记本电脑</td>
        <td>5000</td>
        <td>3</td>
        <td>15000</td>

    </tr>
    </tbody>

    <!--    表格尾部-->
    <tfoot>
    <!--colspan合并列的数量,align="center":水平居中-->
    <td colspan="3" align="center">合计:</td>

    <td>6</td>
    <td>16100</td>
    <td></td>

    </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