Table Data

We have rows, so it's time to fill them with data. The data of a table goes into cells, which we create with the td element (short for table data, a table data cell). We write the data itself as the content of the td element.

<table>
	<tr>
		<td>Row 1, cell 1</td>
		<td>Row 1, cell 2</td>
	</tr>
	<tr>
		<td>Row 2, cell 1</td>
		<td>Row 2, cell 2</td>
	</tr>
</table>

This code is displayed like this:

Row 1, cell 1Row 1, cell 2
Row 2, cell 1Row 2, cell 2

The table has two rows (tr), and each row has two cells (td). There's no element for columns: a column is made up of the cells at the same position in each row. The first td of every row is in the first column, the second td in the second column, and so on.

In the background, we added some CSS to make the table easier to read. You can learn more about CSS in the CSS course.

Instructions

We'll leave the first row empty for now; in the next exercise, we'll put headings in it. In the second row, create two cells (td elements): the first with the content 8/20/2023 and the second with the content 93.

Start programming for free

By signing up, you agree to the Terms of Service and Privacy Policy.

Or sign up with:

3/7