Content and media · Lesson 8 of 16
Tables
Rows and columns with table, tr and td.
7 minutes2 games
A table is <table>, each row a <tr>, each normal cell a <td> and each header cell a <th>. Rows go top to bottom; cells go start to end.
HTML
<style>th, td { border: 1px solid; padding: 8px; } table { border-collapse: collapse; }</style>
<table>
<tr>
<th>Language</th>
<th>Year</th>
</tr>
<tr>
<td>Python</td>
<td>1991</td>
</tr>
<tr>
<td>JavaScript</td>
<td>1995</td>
</tr>
</table>Complete the code
Complete a row with two cells.
<> <td>Cairo</td> <>Egypt</td> </tr>
Exercise
Make a table with a header row (th) and 2 data rows.
HTML
<table> </table>
Learn more from
Played 0 of 2 games
Sign in to save your progress and earn XP.