HTML <caption> alignAtributo
Ejemplo
Tabla con un elemento <caption> alineado a la parte inferior:
<table border="1">
<caption align="bottom">My savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<caption align="bottom">My savings</caption>
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
Pruébalo »
Soporte del navegador
![]()
Todos los navegadores principales soportan el atributo align.
Nota:
- Internet Explorer 8 soporta los valores "left", "right", "top" y "bottom".
- Internet Explorer 9+ soporta los valores "top" y "bottom".
- Firefox soporta los valores "left", "right", "top" y "bottom".
- Opera soporta los valores "left", "right", "top" y "bottom".
- Chrome soporta los valores "top" y "bottom".
- Safari soporta los valores "top" y "bottom".
Definición y uso
HTML5 no soporta el atributo align de <caption>. Use CSS en su lugar.
El atributo align de <caption> está obsoleto en HTML 4.01.
El atributo align especifica la alineación del elemento caption.
Este atributo alinea el caption, como un elemento de bloque, hacia la izquierda, derecha, superior o inferior de la tabla.
Nota de compatibilidad
HTML5 no soporta el atributo align de <caption>. Use CSS en su lugar.
Sintaxis CSS: <caption style="caption-side:bottom"> o <caption style="text-align:left">
En nuestro tutorial de CSS, puede encontrar más información sobrecaption-sidelos detalles del atributo.
Sintaxis
<caption align="left|right|top|bottom">
Valores de atributo
| Valor | Descripción |
|---|---|
| left | El título está a la izquierda de la tabla. |
| right | El título está a la derecha de la tabla. |
| top | El título está en la parte superior de la tabla. |
| bottom | El título está en la parte inferior de la tabla. |
Otras extensiones
Etiqueta HTML <caption>