English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Manual de Referência HTML

大全 de Tags HTML

HTML: Atributo align do <col>

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.

 HTML <col> tag

Exemplo online

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 ‹/›

Browser compatibility

IEFirefoxOperaChromeSafari

Only Opera and Internet Explorer 8 and earlier IE versions support the align attribute (IE9This attribute is not supported).

Definition and usage

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.

Syntax

<col align="left|right|center|justify|char">

Attribute value

ValueDescription
leftAlign content to the left (the default value).
rightAlign content to the right.
centerAlign content centrally (the default value for the th element).
justifyStretch the line so that each line can have an equal length (as in newspapers and magazines).
charAlign content to a specified character.
 HTML <col> tag