19. Creating Basic Data Tables (<table>)
Tables are used to display tabular data (not for layout, which is what CSS is for). A basic table requires three core elements.
19.1 Basic Table Structure
<table>: The container for the entire table.<tr>: Table Row.<td>: Table Data Cell (standard cell).
html
| Cell 1, Row 1 | Cell 2, Row 1 |
| Cell 1, Row 2 | Cell 2, Row 2 |
19.2 Table Headers (<th>)
Table Header cells (<th>) are used to label the columns or rows. They are typically rendered bold and centered by default, and provide semantic meaning.
html
| Name | Age | City |
|---|---|---|
| Alice | 30 | New York |