34 of 133 menu

The tr tag

The tr tag defines a row of a table created using the table tag. Inside the tr tags, you should use the td and th tags, which define the table cells.

Example

Let's create a table with cells th and td:

<table> <tr> <th>Name</th> <th>Surn</th> <th>Salary</th> </tr> <tr> <td>name1</td> <td>surn1</td> <td>200$</td> </tr> <tr> <td>name2</td> <td>surn2</td> <td>1000$</td> </tr> </table> table, td, th { border: 1px solid black; }

:

See also

  • tags thead, tbody and tfoot,
    which group the rows of the table
  • tag caption,
    which sets the title of the entire table
  • property vertical-align,
    which sets the vertical alignment of the text
  • attributes rowspan and colspan,
    which combine the rows and columns of a table
byenru