Summary -

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

Group a block of table rows in HTML document. The <tbody> tag allows grouping a block of table rows in an <table>. It represents the row blocks that consist of table body data.

The tag can be specified like <tbody></tbody> with the table body elements in between the opening and closing tags. The <tbody> element mostly used in conjunction with <thead> and <tfoot> tags to enable table scrolling.

<tbody> tag is optional tag. If <tbody> tag is used, then it must be the child of <table> element after <caption>/<colgroup>/thread> tags. The <tbody> element must have one or more <tr> tags inside.

Syntax -

<tbody>.... </tbody>

Optional Attributes -

AlignSpecifies the content alignment inside the <tbody> element.Not supported in HTML5LeftrightCenterJustify
CharContent aligns to character inside <tbody> tagCharacter
ValignSpecifies the content alignment to vertical inside <tbody> tag.TopMiddleBottombaseline

Example -

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

Output -

Employee Salary
Total $10000
Pawan $5000
Srinivas $5000