<tr>...</tr>
HTML4 HTML5
Creates a table row.
Both opening and closing tags are required.
Example 1
<table>
<tr>
<th>Last Name</th>
<th>First Name</th>
</tr>
<tr>
<td>Kowalski</td>
<td>Jan</td>
</tr>
<tr>
<td>Nowak</td>
<td>Dominika</td>
</tr></table>
The browser will interpret this code as follows:
| Last Name | First Name |
| Kowalski |
Jan |
| Nowak |
Dominika |
The table consists of 2 columns and 3 rows. Each row is contained between the <tr> and </tr> tags. Inside the rows, the <td> tags define individual table cells.
The appearance of a table row can be modified using the following attributes:
align="..." - Not supported in HTML5, specifies the default horizontal alignment of text in a table row:
- left - left-aligns text,
- center - centers text,
- right - right-aligns text to cell edges,
- justify - justifies text (aligns to both left and right edges of cells),
- char
bgcolor="..." - Not supported in HTML5, specifies the background color of a table row:
- rgb(x,y,z) - color specified by three numbers ranging from 0 to 255 each, defining the RGB components of the desired color,
- #xxxxxx - hexadecimal RGB color value,
- name - English color name (e.g., bgcolor="red").
valign="parameter" - Not supported in HTML5, specifies the default vertical alignment of text in a table row:
- top - aligns to the top edge of the cell,
- middle - centers vertically,
- bottom - aligns to the bottom edge of the cell,
- baseline - aligns to the baseline, especially useful when using fonts of different sizes.