CHAPTER 3Tables
Tables use many tags:
<table> | a table |
<thead> | "table header" |
<tbody> | "table body" |
<th> | "table column header" |
<tr> | "table row" |
<td> | "table data" |
A table:
<table>
<thead>
<tr>
<th>Day of the week</th>
<th>Mode</th>
</tr>
</thead>
<tbody>
<tr>
<td>Tuesday</td>
<td>In person</td>
</tr>
<tr>
<td>Thursday</td>
<td>Online</td>
</tr>
</tbody>
</table>
An important CSS property of tables is border-collapse
, which joins together the borders of adjacent cells (otherwise each cell has its own border and there is a separation between them).
To join cells horizontally or vertically (as can be done in spreadsheets), the attributes colspan
and rowspan
can be used in <td>
elements.