表格分组标签的使用

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>年终数据报表</title>
<style>
.table1{
	width:100%;  //相对于整个页面宽度占100%
	height:auto; //高度自动
}

.table1 thead tr{
	background-color:#CC0;
}

.table1 tbody tr th{
	background-color:#CC6;
	width:20%;  //相对于表格宽度占20%
}
.table1 tbody tr td{
	background-color:#CCC;
}

.table1 tfoot tr th{
	background-color:#CC6;
}
.table1 tfoot tr td{
	background-color:#CCC;
}


</style>
</head>

<body>
<table class="table1">
    <thead>
        <tr>
            <th colspan="5">年终数据报表</th>
        </tr>   
    </thead>
        
    <tbody>
        <tr>
            <th></th>
            <th>1月</th>
            <th>2月</th>
            <th>3月</th>
            <th>小计(RMB)</th>
        </tr>
        <tr>
            <th>天津</th>
            <td>10</td>
            <td>26</td>
            <td>50</td>
            <td>86</td>
        </tr>
        <tr>
            <th>北京</th>
            <td>40</td>
            <td>30</td>
            <td>50</td>
            <td>120</td>
        </tr>
        <tr>
            <th>上海</th>
            <td>20</td>
            <td>10</td>
            <td>30</td>
            <td>60</td>
        </tr>
    </tbody>
    
    <tfoot>
        <tr>
            <th>总计(RMB)</th>
            <td>70</td>
            <td>66</td>
            <td>130</td>
            <td>266</td>
        </tr>
    </tfoot>
</table>
</body>
</html>

  • 2
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值