align attribute (div, Hn, p, td, tr, ...)
Sets the horizontal alignment of the contents in an object.
This attribute is deprecated.
Use the text-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 to the center of the available space. Same as middle. | |||||||
Aligns to the left and right edges. | |||||||
Default. Aligns to the left edge. | |||||||
Aligns to the center of the available space. Same as center. | |||||||
Aligns to the right edge. |
Default: left.
Example HTML code 1:
This example illustrates the use of the align attribute:
|
||||
<table border="1px" style="width:400px;"> <tr> <td align="center">Contents are aligned to the center.</td> </tr> <tr> <td align="left">Contents are aligned to the left</td> </tr> </table> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
Recommendation:
|
||||
<table border="1px" style="width:400px;"> <tr> <td style="text-align:center;">Contents are aligned to the center.</td> </tr> <tr> <td style="text-align:left;">Contents are aligned to the left</td> </tr> </table> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
Related pages:
External links:
User Contributed Comments