English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
El atributo align define el alineamiento del elemento de subtítulo. Este atributo debe alinear el título como un elemento de bloque a la izquierda, derecha, arriba o abajo de la tabla.
Tabla con elementos <caption> alineados a izquierda, derecha, abajo y arriba:
<!DOCTYPE html> <html> <head> <meta charset="utf-8">-8"> <título>Uso del atributo align de <caption> en HTML</título>-Tutoriales básicos(oldtoolbag.com)</título>/título> <style> tabla, th, td { borde: 1px sólido negro; } </style> </head> <body> <p>align="left":</p> <table> <caption align="left">My savings</caption> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> <p>align="right":</p> <table> <caption align="right">My savings</caption> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> <p>align="top":</p> <table> <caption align="top">My savings</caption> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> <p>align="bottom":</p> <table> <caption align="bottom">My savings</caption> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> <td>$100</td> </tr> </table> </body> </html>测试看看 ‹/›
IEFirefoxOperaChromeSafari
所有主流浏览器都支持 align 属性。
注意:
Internet Explorer 8 支持 "left", "right", "top", 和 "bottom" 值。
Internet Explorer 9+ 支持 "top", 和 "bottom" 值。
Firefox 支持 "left", "right", "top", 和 "bottom" 值。
Opera 支持 "left", "right", "top", 和 "bottom" 值。
Chrome 支持"top", 和 "bottom" 值。
Safari 支持 "top", 和 "bottom" 值。
HTML5 No se admite la propiedad <caption> alineación. Utilice CSS en su lugar.
La propiedad alineación de <caption> en HTML 4.01 Se ha obsolecido.
La propiedad alineación especifica el modo de alineación del elemento caption.
Esta propiedad alinea el caption como un elemento de bloque a la izquierda, derecha, arriba o abajo de la tabla.
THTML5 No se admite la propiedad <caption> alineación. Utilice CSS en su lugar.
Sintaxis de CSS: <caption estilo="caption-lateral:abajo"> o <caption estilo="text-alineación:left">
Ejemplo de CSS: Alineación del título de la tabla
En nuestra guía de CSS, puede encontrar más información sobrecaption-lateral Detalles del atributo.
<caption alineación="izquierda|derecha|arriba|abajo">
Valor | Descripción |
---|---|
izquierda | El título está a la izquierda de la tabla. |
derecha | El título está a la derecha de la tabla. |
arriba | El título está encima de la tabla. |
abajo | El título está debajo de la tabla. |