1、 作业
<!DOCTYPE html>
<html lang="en">
<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>Document</title>
</head>
<body>
<table border="1" width="80%">
<!-- 标题 -->
<caption>
商品信息表
</caption>
<!-- 表头 -->
<thead>
<tr align="center">
<td>ID</td>
<td>品名</td>
<td>价格</td>
<td>数量</td>
<td>金额</td>
</tr>
</thead>
<!-- 表体 -->
<tbody>
<tr align="center" >
<td>1</td>
<td>方便面</td>
<td colspan="3" bgcolor="yellow">1</td>
<!-- <td>1</td>
<td>1</td> -->
</tr>
<tr align="center">
<td>2</td>
<td>馒头</td>
<td>2</td>
<td rowspan="2" bgcolor="green">2</td>
<td>4</td>
</tr>
<tr align="center">
<td>3</td>
<td>蔬菜</td>
<td>3</td>
<!-- <td>2</td> -->
<td>6</td>
</tr>
</tbody>
<!-- 表尾 -->
<tfoot>
<tr align="center">
<td>汇总:</td>
<td>3</td>
<td></td>
<td>5</td>
<td>11</td>
</tr>
</tfoot>
</table>
</body>
</html>
2、笔记
标准的table表格写法
```html
<table border="1" width="80%">
<!-- 标题 -->
<caption>
<!-- 标题内容-->
</caption>
<!-- 表头 -->
<thead>
<tr align="center">
<td> </td>
</tr>
</thead>
<!-- 表体 -->
<tbody>
<tr align="center" >
<td>1</td>
</tr>
<tr align="center">
<td>2</td>
</tr>
<tr >
<td>3</td>
</tr>
</tbody>
<!-- 可以有多个tbody -->
<tbody>
<tr align="center" >
<td>1</td>
</tr>
<tr align="center">
<td>2</td>
</tr>
<tr >
<td>3</td>
</tr>
</tbody>
<!-- 表尾 非必须 -->
<tfoot>
<tr>
<td></td>
</tr>
</tfoot>
</table>
```
table合并行和和并列的属性,属性必须用于单元格内,不能用于<tr>
rowspan可以用于行合并
colspan可以用于列合并