use of table
1. The code is as follows:
# 生成3行2列的表格 ---快捷键--- table>tr*5>td*3{项目}
<table border="1"> # border加一个像素的边框
<caption>工程项目表</caption>
<tr> # 行
<td>项目</td> # 列
<td>项目</td>
<td>项目</td>
</tr>
<tr>
<td>项目</td>
<td>项目</td>
<td>项目</td>
</tr>
<tr>
<td rowspan="2">项目</td> # rowspan合并行 指定合并数量
<td>项目</td>
<td>项目</td>
</tr>
<tr>
<td>项目</td>
<td>项目</td>
</tr>
</table>
- The effect is shown as follows
Project list
project |
project |
project |
project |
project |
project |
project |
project |
project |
project |
project |
Second, the code is as follows:
<table border="3">
<caption>学生成绩表</caption>
<thead> # 表头
<tr>
<th>班级</th>
<th>姓名</th>
<th>语文</th>
<th>数学</th>
</tr>
</thead>
<tbody> # 表身
<tr>
<td rowspan="3">2018</td>
<td>刘明湘</td>
<td>90</td>
<td>98</td>
</tr>
<tr>
<td>林志玲</td>
<td>78</td>
<td>66</td>
</tr>
<tr>
<td>高圆圆</td>
<td>69</td>
<td>87</td>
</tr>
<tr>
<td>2017</td>
<td>李易峰</td>
<td>38</td>
<td>47</td>
</tr>
</tbody>
<tfoot> #表尾
<tr>
<td colspan="2" align="right">平均分</td>
<td>67</td>
<td>76</td>
</tr>
</tfoot>
</table>
Student Transcript
class |
Name |
language |
math |
2018 |
Liu Mingxiang |
90 |
98 |
Lin Chiling |
78 |
66 |
Gao Yuanyuan |
69 |
87 |
2017 |
Li Yifeng |
38 |
47 |
The average score |
67 |
76 |