English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
A propriedade align define o alinhamento horizontal do conteúdo relacionado ao elemento col, o tag <col> especifica as propriedades da coluna para cada coluna dentro do elemento <colgroup>, a tag <col> é útil para aplicar estilos a toda a coluna, em vez de repetir o estilo em cada célula de uma linha.
Use <colgroup> e <col> para definir a cor de fundo de três colunas:
!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Uso do atributo align do <col> no HTML-Tutorial básico(oldtoolbag.com)</title> <style>table, th, td { border: 1px sólido preto;}</style> </head> <body> <table> <colgroup> <col span="2" estilo="background-cor:vermelha"> <col estilo="background-cor:amarela"> </colgroup> <tr> <th>ISBN</th> <th>Title</th> <th>Price</th> </tr> <tr> <td>3476896</td> <td>My first HTML</td> <td>$53</td> </tr> <tr> <td>5869207</td> <td>My first CSS</td> <td>$49</td> </tr> </table> </body> </html>Teste veja ‹/›
IEFirefoxOperaChromeSafari
Only Opera and Internet Explorer 8 and earlier IE versions support the align attribute (IE9This attribute is not supported).
HTML5 The <col> align attribute is not supported.
The align attribute specifies the horizontal alignment of the content related to the col element.
The <col> tag specifies column properties for each column within the <colgroup> element.
The <col> tag is very useful for applying styles to the entire column, rather than repeating the style for each cell in each row.
<col align="left|right|center|justify|char">
Value | Description |
---|---|
left | Align content to the left (the default value). |
right | Align content to the right. |
center | Align content centrally (the default value for the th element). |
justify | Stretch the line so that each line can have an equal length (as in newspapers and magazines). |
char | Align content to a specified character. |