HTML <tbody> alignAttribute

HTML tbody 标签参考手册HTML <tbody> Tag

Examples

Right-align the content in the <tbody> element:

<table border="1" width="100%">
<thead>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
</thead>
<tbody align="right">
<tr>
<td>January</td>
<td>$100</td>
</tr>
<tr>
<td>February</td>
<td>$80</td>
</tr>
</tbody>
</table>

Try it Yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the align attribute.

Note:IE does not correctly handle the "justify" value; IE will treat it as centered.

Note:Almost no browser can correctly handle the "char" value.


Definition and Usage

HTML5 does not support the <tbody> align attribute. Use CSS instead.

The align attribute specifies the horizontal alignment of the content within the <tbody> element.


Syntax

<tbody align="left|right|center|justify|char">

Attribute Values

Value Description
left Left-aligns content (default for table data).
right Right-aligns content.
center Center-aligns content (default for th elements).
justify Stretches the lines so that each line has equal width (like in newspapers and magazines).
char Aligns the content to a specified character.


HTML tbody 标签参考手册HTML <tbody> Tag Other Extensions