How To Align A Table

Table of contents:

How To Align A Table
How To Align A Table

Video: How To Align A Table

Video: How To Align A Table
Video: How To Align a Table Saw Blade to Miter Slot 2024, November
Anonim

In building sites using the popular and simple HTML language, there are certain rules for the design and alignment of tables. It is not uncommon for the table you have placed on the page to shift and therefore need to be centered on the page, or left or right to fit the overall page layout. By default, a table in HTML is left-aligned and therefore you need to know the tags with which you can reposition it.

How to align a table
How to align a table

Instructions

Step 1

To align the table in the center of the web page, use the attribute present in the table tag. To align the table to the right, use the attribute accordingly. To align to the left of the page, change the attribute value to left.

Step 2

In addition to the table itself, you can align the contents of its cells - horizontally or vertically. To horizontally align the contents of table cells, use the align attribute of the tr tag with the appropriate value. For cells, apply it to the td tag.

Step 3

Experiment with different row alignment in different cells - you can align text in one table cell to the center, and to the right or left in another.

Step 4

To vertically align text, use the tr and td tag attributes to position the content at the top of the cell. To position the content on the middle line of the cell, change the value from top to middle, and to align to the bottom of the cell, change the value to bottom. You can also align content to the baseline (baseline value).

Step 5

By adjusting the alignment of the contents of the cells both horizontally and vertically, you can give the table exactly the look it should have when it is finished on your web page.

Recommended: