240 CHAPTER 5 More HTML5
<td>2012</td>
<td>BMW</td>
<td>Z4</td>
<td>40,000</td>
</tr>
<tr>
<th>4</th>
<td>2003</td>
<td>Mazda</td>
<td>Miata</td>
<td>5,000</td>
</tr>
</tbody>
<tfoot>
<tr>
<th colspan="5">Total:</th>
<th>62,000</th>
</tr>
</tfoot>
</table>
To help illustrate the rowspan and colspan attributes, a black border is added to the table
cells. The following is the complete CSS file.
table {
border: medium solid #000000;
}
thead th {
background-color: #BDEAFF;
width: 100px;
}
tbody th {
background-color: #FFFF99;
}
tfoot th {
background-color: #C2FE9A;
}
tfoot th:first-of-type {
text-align: right;
}
tfoot th:last-of-type {
text-align: right;
}
td {
text-align: center;
border: thin solid #000000;
}
td:last-of-type {