HTML Tables: Rows, Cells and Tabular Data
Create a table row
A table represents information whose row and column relationships matter. Put each row in tr and each data cell in td. This first example isolates the structure; the next lesson adds meaningful header cells and a caption.
<table> <tr> <td>Monday</td> <td>12</td> </tr></table>One row contains two cells.
Add more rows
Cells in the same position in successive rows form a column. Here the first column holds a day and the second holds the number of orders. Write one tr for each record.
<table> <tr> <td>Monday</td> <td>12</td> </tr> <tr> <td>Tuesday</td> <td>9</td> </tr></table>Two rows and two columns appear.
Keep values in their own cells
A space inside a cell does not create another column. A separate td creates a separate cell. The browser may show little spacing and no border by default; visual decoration belongs to CSS, which is a separate topic.
<table> <tr> <td>North branch</td> <td>Open</td> <td>8</td> </tr> <tr> <td>South branch</td> <td>Closed</td> <td>0</td> </tr></table>Each record has three independent values.
Common mistakes and practice
Use tables for data, not for arranging navigation or page panels. Keep each cell inside a row and close tags explicitly while learning. Try adding a third day with its own number; headers come next.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
HTML Tables: Rows, Cells and Tabular Data — Knowledge Check
Apply table structure and accessibility concepts from this lesson.
Which element groups the cells of one row?
How many cells does <tr><td>North office</td><td>8</td></tr> contain?
Which content is best suited to a data table?
Which element should hold an ordinary data value within a row?
A site needs two visual columns of unrelated content. What is preferable to a data table?