包括HTML关于表格的<table>,<caption>,<colgroup>,<col>,<thead>,<tbody>,<tfoot>,<tr>,<th>,<td>
所有元素的HTML示例。
简单的HTML表格包含<table>,<tr>,<th>,<td>元素就可以了。包含完整的表格元素的表格,对表格更加好管理。
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8"/>
<title>HTML Element Test Page</title>
</head>
<body>
<table border="1">
<caption>Monthly savings</caption>
<colgroup>
<col span="1" style="background-color: green"/>
<col style="background-color: yellow"/>
</colgroup>
<thead>
<tr><th>Month</th><th>Savings</th></tr>
</thead>
<tbody>
<tr><td>January</td><td>$100</td></tr>
<tr><td>February</td><td>$80</td></tr>
</tbody>
<tfoot>
<tr><td>Sum</td><td>$180</td></tr>
</tfoot>
</table>
</body>
</html>