tbody tag align attribute in HTML

Last Updated on August 5, 2019 by Roshan Parihar


Definition: The tbody tag align attribute is used to align the main content of the table in horizontal direction.


Syntax:


List of expected values of tbody tag align attribute

Sr. No. value Description
1 left left aign the main content of table.
2 right right aign the main content of table.
3 center center aign the main content of table.
4 justify justify the main content of table.
5 char aign the main content to a specific character.

use attribute value align=”left” in tbody

Left align the main content using align=”left” in tbody part of the table.

Output

Keyboard shortcuts:

Sr. No. name
1 Ctrl+S: To save the file.
2 Ctrl+V: To save the content.
3 Ctrl+C: To copy the content.

use attribute value align=”right” in tbody

Right align the main content using align=”right” in tbody part of the table.

Output

Computer network terms:

Sr. No. name
1 Local Area Network
2 Wide Area Network
3 Cisco Certified Network Association

use attribute value align=”center” in tbody

Center align the main content using align=”center” in tbody part of the table.

Output

Computer hardware devices:

Sr. No. name
1 Monitor
2 Keyboard
3 Printer

use attribute value align=”justify” in tbody

Justify the main content using align=”justify” in tbody part of the table.

Output

Shoes branded companies:

Sr. No. name
1 Reebok
2 Red & Chief
3 Woodland

use attribute value align=”char” in tbody

Align the main content to a specific character using align=”justify” in tbody part of the table.

Note: char attribute is not supported with any major browsers.

Output

Best Indian Cities:

Sr. No. name
1 Delhi
2 Mumbai
3 Chennai

Resources and References

  1. W3C Specification.
  2. W3C project using Github.
  3. W3 resource.

Leave a comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.