html的table多级表头表格的代码
2024-09-03 02:31:39
1,两级表头的代码
<html>
<head>
<title>多层表头</title>
<link rel="stylesheet" href="./css/reset.css">
<style type="text/css">
td,
th {
font-style: normal;
font-weight: normal;
text-align: center;
}
tr {
height: 48px;
}
.twoHead th {
width: 6.25%;
height: 48px;
padding: 0 10px;
font-size: 14px;
font-weight: normal;
}
.firstHead th {
font-size: 14px;
font-weight: bold;
}
table {
border: none;
border-collapse: collapse;
border-color: #D8DFE6;
}
table thead {
background: #F3FDFF;
}
</style>
</head>
<body>
<div></div>
<div class="table">
<table border="1" cellspacing="0" cellpadding="10" width="100%">
<thead>
<tr class="firstHead">
<th colspan="1" rowspan="2">序号</th>
<th colspan="1" rowspan="2">村庄名称</th>
<th colspan="6">本周采集房屋总量(户)</th>
<th colspan="3">累计采集房屋总量(人)</th>
<th colspan="4">本周隐患处理情况(处)</th>
</tr>
<tr class="twoHead">
<th>合计</th>
<th>对比上周变化</th>
<th>出租房屋数量</th>
<th>对比上周变化</th>
<th>自住房屋数量</th>
<th>对比上周变化</th>
<th>总计</th>
<th>出租房屋累计</th>
<th>自主房屋累计</th>
<th>新增隐患</th>
<th>消除隐患</th>
<th>现存隐患</th>
<th>对比上周</th>
</tr>
</thead>
<tbody>
<tr>
<td>∞</td>
<td>30万</td>
<td>20万</td>
<td>60万</td>
<td>100万</td>
<td>看着办</td>
<td>∞∞</td>
<td>20万</td>
<td>100万</td>
<td>看着办</td>
<td>∞∞</td>
<td>20万</td>
<td>20万</td>
<td>20万</td>
<td>20万</td>
</tr>
</tbody>
</table>
</div>
</body>
</html
效果图片为:
2,两个以上级表头的代码
<html>
<head>
<title>多层表头22</title>
<link rel="stylesheet" href="./css/reset.css">
<style type="text/css">
td,
th {
font-style: normal;
font-weight: normal;
text-align: center;
}
tr {
height: 48px;
}
.firstHead,
.twoHead,
.threeHead {
height: 32px;
}
.fourHead {
height: 64px;
}
.firstHead th {
font-size: 14px;
font-weight: bold;
}
table {
border: none;
border-collapse: collapse;
border-color: #D8DFE6;
}
table thead {
background: #F3FDFF;
}
table tbody td {
width: 6.3%;
}
table tbody tr {
height: 50px;
}
</style>
</head>
<body>
<div></div>
<div class="table">
<table border="1" cellspacing="0" cellpadding="10" width="100%">
<thead>
<tr class="firstHead">
<th colspan="1" rowspan="5" width="4%">序号</th>
<th colspan="1" rowspan="5" width="6.4%">终端使用人</th>
<th colspan="14">工作开展情况</th>
</tr>
<tr class="twoHead">
<th colspan="1" rowspan="4">工作量总计</th>
<th colspan="9">采集情况</th>
<th colspan="4">检查情况</th>
</tr>
<tr class="threeHead">
<th colspan="3" rowspan="1">人口</th>
<th colspan="3" rowspan="1">房屋</th>
<th colspan="3" rowspan="1">车辆</th>
<th colspan="4" rowspan="1">房屋隐患</th>
</tr>
<tr class="fourHead">
<th colspan="1" rowspan="2">总数</th>
<th colspan="1" rowspan="2">户籍</th>
<th colspan="1" rowspan="2">流动</th>
<th colspan="1" rowspan="2">总数</th>
<th colspan="1" rowspan="2">自住</th>
<th colspan="1" rowspan="2">出租</th>
<th colspan="1" rowspan="2">总数</th>
<th colspan="1" rowspan="2">机动车</th>
<th colspan="1" rowspan="2">非机动车</th>
<th colspan="1" rowspan="2">总数</th>
<th colspan="1" rowspan="2">生活安全</th>
<th colspan="1" rowspan="2">出租管理</th>
<th colspan="1" rowspan="2">房屋功能</th>
</tr>
</thead>
<tbody>
<tr>
<td width="4%">∞</td>
<td>30万</td>
<td>20万</td>
<td>60万</td>
<td>100万</td>
<td>看着办</td>
<td>∞∞</td>
<td>20万</td>
<td>100万</td>
<td>看着办</td>
<td>∞∞</td>
<td>20万</td>
<td>20万</td>
<td>20万</td>
<td>20万</td>
<td>20万</td>
</tr>
</tbody>
</table>
</div>
</body>
</html
图片显示效果:
最新文章
- C# BackgroundWorker 详解
- a different object with the same identifier value was already associated with the session:
- GMM简单解释
- C#获取本机IP且过滤非真实网卡(如虚拟机网卡)
- oracle删除表语句
- iphone上click事件不触发的问题解决。
- tangible T4 Editor 2.2.3 for VS2010 / VS2012 / VS2013 Preview
- Mysql RR隔离更新列没有索引 会锁全表
- linux内核包转发过程(三)NIC帧接收分析
- onDraw(canvas)和dispatchDraw(canvas)方法
- java之Spring(IOC)装配Bean(手动装配、自动装配、注解装配)
- 【ASP.NET Core】JSON Patch 使用简述
- redis的LRU算法(一)
- 【BZOJ2117】 [2010国家集训队]Crash的旅游计划
- MYSQL查询系列 常考问题
- Asp.net core 跨域设置
- MT【25】切线不等式原理及例题
- mac ci框架安装使用 memcached存session
- Kubernetes1.91(K8s)安装部署过程(四)--Master节点安装
- Unity3d Transform.forward和Vector3.forward的区别!