Tables: Table Row Element
Tables: Table Row Element
Tables
<tr> Table Row Element
The table row element, <tr> , is used to add rows
to a table before adding table data and table <table>
headings. <tr>
...
</tr>
</table>
https://www.codecademy.com/learn/learn-html/modules/learn-html-tables/cheatsheet 1/4
5/19/2020 Introduction to HTML: Tables Cheatsheet | Codecademy
rowspan Attribute
Similar to colspan , the rowspan attribute on
a table header or table data element indicates how <table>
many rows that particular cell should span within the <tr>
table. The rowspan value is set to 1 by default <th>row 1:</th>
and will take any positive integer up to 65534. <td>col 1</td>
<td>col 2</td>
</tr>
<tr>
<th rowspan="2">row 2 (this row
will span 2 rows):</th>
<td>col 1</td>
<td>col 2</td>
</tr>
<tr>
<td>col 1</td>
<td>col 2</td>
</tr>
<tr>
<th>row 3:</th>
<td>col 1</td>
<td>col 2</td>
</tr>
</table>
https://www.codecademy.com/learn/learn-html/modules/learn-html-tables/cheatsheet 2/4
5/19/2020 Introduction to HTML: Tables Cheatsheet | Codecademy
colspan Attribute
The colspan attribute on a table header <th>
or table data <td> element indicates how many
<table>
columns that particular cell should span within the <tr>
table. The colspan value is set to 1 by default
<th>row 1:</th>
and will take any positive integer between 1 and
<td>col 1</td>
1000. <td>col 2</td>
<td>col 3</td>
</tr>
<tr>
<th>row 2:</th>
<td colspan="2">col 1 (will span 2
columns)</td>
<td>col 2</td>
<td>col 3</td>
</tr>
</table>
https://www.codecademy.com/learn/learn-html/modules/learn-html-tables/cheatsheet 3/4
5/19/2020 Introduction to HTML: Tables Cheatsheet | Codecademy
https://www.codecademy.com/learn/learn-html/modules/learn-html-tables/cheatsheet 4/4