What is a tr Tag in HTML5?

In HTML5
1 min read

The <tr> HTML tag is used to create a new row in a table. This tag can be used alone or in combination with other tags such as <td> and <th>. The <tr> tag is part of the HTML Table elements that allow developers to create a structured layout for displaying data in a tabular format.

Code Example:

<table>
<tr>
<td>Cell 1</td>
<td>Cell 2</td>
</tr>
<tr>
<td>Cell 3</td>
<td>Cell 4</td>
</tr>
</table>

Attributes:

  • align: Specifies the horizontal alignment of the table data. Values include left, right, center.
  • valign: Specifies the vertical alignment of the table data. Values include top, middle, bottom, and baseline.
  • char: Specifies a character used for cell justification.
  • charoff: Specifies the number of characters from the edge of the cell to align with the character specified in the char attribute.
  • scope: Specifies whether the header is associated with the row or column of cells. Values include row and col.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Carlos Baez

Subscribe now to keep reading and get access to the full archive.

Continue Reading