<tr> : Table Row element

Introduction

The <tr> element in HTML stands for “Table Row.” It’s used to define a row within a table. Each row in an HTML table consists of one or more table data cells (<td>) or table header cells (<th>).

Here’s an example of how you might use the <tr> element to create a table row:

Output :

In this example:

  • Each <tr> element represents a row in the table.
  • Within each <tr>, we have table cells represented by <td> (data cells) or <th> (header cells).
  • The first <tr> typically contains header cells denoted by <th>, while subsequent <tr> elements contain data cells denoted by <td>.
  • CSS is used to style the table, including setting border styles, cell padding, and alignment.

This results in a simple table with three columns: Name, Age, and Country, and three rows of data.

Leave a Comment