task1表格
程序员文章站
2022-03-16 09:00:37
...
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>12月22日作业 task1表格</title>
</head>
<body>
<table class="" border="1" width="500">
<caption>表格标题是caption </caption>
<thead>
<tr>
<th>表头</th>
<th>文件</th>
<th>是</th>
<th>thead</th>
</tr>
</thead>
<tbody>
<tr>
<td>我是</td>
<td>第一行</td>
<td>的</td>
<td>内容</td>
</tr>
<tr>
<td class=hbl rowspan="3" >如果合并列用
<p>rowspan="列数"</p></td>
<td>PHP</td>
<td>中文网</td>
<td>I LOVE YOU</td>
</tr>
<tr>
<td>我的</td>
<td>学号</td>
<td>296113</td>
<!-- <td>您好</td> -->
</tr>
<tr>
<td>这是</td>
<td>我的</td>
<td>表格作业</td>
<!-- <td>您好</td> -->
</tr>
<tr>
<td class=hbh colspan="4">合并行用colspan="行数"
<p>并注释后面行数</p>
</td>
<!-- <td>我</td>
<td>是超出的部分被</td>
<td>注释</td> -->
</tr>
</tbody>
<tfoot border="1" class="tfoot">
<tr>
<td colspan="4" >表格的底部是
<p>用tfoot标签</p>
</td>
<!-- <td></td>
<td></td>
<td></td> -->
</tr>
</tfoot>
</table>
<style>
table {
width: 900px;
text-align: center;
background-color: cadetblue;
}
.hbl{
background-color: aqua;
}
.hbh{
background-color: azure;
}
</style>
</body>
</html>