align attribute (caption, legend)
This attribute is deprecated in HTML 4.01.
- In Internet Explorer earlier than version 8, use the vAlign attribute to align a caption element to the top or bottom side of a table element.
- In Firefox, Opera, Google Chrome, Safari and in Internet Explorer from version 8, use the caption-side 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 bottom-center. | |||||||
Aligns to the center. Same as middle. | |||||||
Aligns to the left. | |||||||
Aligns to the center. Same as center. | |||||||
Aligns to the right. | |||||||
Aligns to the top-center. |
Default: this attribute has no default value.
Example HTML code 1:
This example illustrates the use of the align attribute:
|
||||
<table border="1px"> <caption align="right">Fruits</caption> <tr> <td>Apple</td> <td>Pear</td> <td>Peach</td> </tr> </table> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 2:
Recommendation:
|
||||
<table border="1px"> <caption style="text-align:center;">Fruits</caption> <tr> <td>Apple</td> <td>Pear</td> <td>Peach</td> </tr> </table> |
||||
|
||||
Did you find this example helpful?
|
Example HTML code 3:
Cross-browser solution to align to the top or bottom:
|
||||
<table border="1px"> <caption align="bottom" style="caption-side:bottom;">Fruits</caption> <tr> <td>Apple</td> <td>Pear</td> <td>Peach</td> </tr> </table> |
||||
|
||||
Did you find this example helpful?
|
Supported by tags:
Related pages:
External links:
User Contributed Comments