Summary -

In this topic, we described about the <tr> tag along with detailed example.

Table row in HTML document. The <tr> tag used to specify the row in an HTML <table>. Table row contains one or more data cells (td) and/or header cells (th).

<tr> elements are child of <table>, <tbody>, <thead> or <tfoot> elements. <tr> element can be specified after any <caption>, <colgroup>, and <thead> elements.

The tag can be specified like <tr></tr> with the table cell elements in between the opening and closing tags.

Syntax -

<thead>.... </thead>

Optional Attributes -

AlignSpecifies the tr content alignment.Not supported in HTML5centercharjustifyleftright
BgcolorSpecifies the tr background color.Not supported in HTML5Rgb(x,x,x)#xxxxxxColorname
CharSpecifies the tr content to char.Not supported in HTML5Character
ValignSpecifies the tr content should be vertically aligned.Not supported in HTML5TopMiddleBottombaseline

Example -

<!DOCTYPE html>
		<title> Table element example.. </title>

Output -

Employee Salary
Total $10000
Pawan $5000
Srinivas $5000