任务描述
本关任务:创建一个不规则的表格。实现的效果如下图所示:
单元格的合并
相关知识
为了完成本关任务,你需要掌握:1.水平方向单元格的合并,2.垂直方向单元格的合并。
水平方向单元格的合并
将两个或多个水平方向的单元格合并,可以在th或td标签中使用colspan属性来设置,属性的取值为合并的单元格的数目。
用法示例:
示例如下:
测试说明
补充代码后,请点击测评,平台会对你编写的代码进行测试,如果正确则完成闯关任务。
越努力越幸运,祝你成功!
代码示例
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>签到表</title>
<style type="text/css">
th{background-color:#00ff33;}
td{background-color:#00ffff;}
</style>
</head>
<body>
<table border="2" width="400" bordercolor="#00ff00" cellpadding="6">
<caption>签到表</caption>
<!-- ********* Begin ********* -->
<tr>
<th rowspan="2">姓名</th>
<th colspan="2">签到</th>
<th rowspan="2">备注</th>
</tr>
<tr>
<th>第1次</th>
<th>第2次</th>
</tr>
<tr>
<td>张三</td>
<td></td>
<td></td>
<td></td>
</tr>
<!-- ********* End ********* -->
</table>
</body>
</html>