align attribute (hr, iframe, marquee, table)
Sets the horizontal alignment of an object relative to its parent.
This attribute is deprecated.
Use the vertical-align style property instead.
JavaScript page for this attribute: align. You can find other example(s) there. |
Possible values:
String that sets the type of alignment.
One of the following values:
Aligns the table to the center of the document. Same as middle. | |||||||
Aligns the table to the left of the document. | |||||||
Aligns the table to the center of the document. Same as center. | |||||||
Aligns the table to the right of the document. |
Default: this attribute has no default value.
Example HTML code 1:
This example illustrates the use of the align attribute:
|
||||
The following table is aligned to the center: <table border="1px" style="width:200px;" align="center"> <tr> <td>First cell.</td> <td>Second cell.</td> </tr> </table> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
Recommendation:
|
||||
<div style="text-align:center;"> <table border="1px" style="width:200px; text-align:left;"> <tr> <td>First cell.</td> <td>Second cell.</td> </tr> </table> </div> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
External links:
align (IFRAME, TABLE) (MSDN)
align (HR) (MSDN)
align (Safari Reference Library)
align (TABLE) (W3C)
align (HR) (W3C)
align (HR) (MSDN)
align (Safari Reference Library)
align (TABLE) (W3C)
align (HR) (W3C)
User Contributed Comments