HTML Tables & Data Grids
HTML Tables are the original way to display structured data. While not for layout, they are essential for datasets, schedules, and comparison charts.
The Container and Rows
Every table starts with <table>. Inside, we don't define columns directly. Instead, we define rows using <tr> (Table Row).
Data vs Headers
Inside a row, you place cells. Use <td> for standard data and <th> for headers. Headers are crucial for accessibility, allowing screen readers to understand the context of the data.
Merging Cells
To make a cell span multiple columns, use the colspan attribute. To span multiple rows, use rowspan. This allows for complex grid layouts within the data table.
View Full Transcript+
This section contains the detailed breakdown of the table lesson. It covers table, tr, td, and th usage. It also explains the semantic groups thead, tbody, and tfoot which are essential for long tables and printing styles.
