Use the TH element to define table headers.
| Firstname | Jill | Eve |
|---|---|---|
| Lastname | Smith | Jackson |
| Age | 50 | 94 |
The first column becomes table headers if you set the first table cell in each table row to a TH element:
| Firstname | Jill | Eve |
|---|---|---|
| Lastname | Smith | Jackson |
| Age | 50 | 94 |
To left-align the table headers, use the CSS text-align property.
| Firstname | Lastname | Age |
|---|---|---|
| Jill | Smith | 50 |
| Eve | Jackson | 94 |
Use the colspan attribute to have a header span over multiple columns.
| Name | Age | |
|---|---|---|
| Jill | Smith | 50 |
| Eve | Jackson | 94 |
To add a caption to a table, use the caption tag.
| Month | Savings |
|---|---|
| January | $100 |
| February | $50 |