Latest web development tutorials

tag HTML <col>

Exemplos

tag <COLGROUP> e <col> para as três colunas da tabela definir a cor de fundo:

<table border="1">
  <colgroup>
    <col span="2" style="background-color:red">
    <col style="background-color:yellow">
  </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>
</table>

tente »

Suporte a navegadores

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Todos os principais navegadores suportam tag <col>.


definições e instruções tag

<Col> tag especifica <colgroup> atributos coluna para cada elemento da coluna dentro.

Usando tag <col>, você pode aplicar um estilo a uma coluna inteira, em vez de exigir repetido para cada célula em cada linha ou definir o estilo.


Diferenças entre HTML 4.01 e HTML5

HTML5 não é mais suportado em HTML 4.01 na maioria das propriedades.


As diferenças entre HTML e XHTML

Em HTML, tag <col> não tem nenhuma marca de fim.

Em XHTML, tag <col> devem estar devidamente fechados.


propriedade

属性 描述
align left
right
center
justify
char
HTML5 不支持。规定与 <col> 元素相关的内容的水平对齐方式。
char character HTML5 不支持。规定根据哪个字符来对齐与 <col> 元素相关的内容。
charoff number HTML5 不支持。规定第一个对齐字符的偏移量。
span number 规定 <col> 元素应该横跨的列数。
valign top
middle
bottom
baseline
HTML5 不支持。规定与 <col> 元素相关的内容的垂直对齐方式。
width %
pixels
relative_length
HTML5 不支持。 Specifies the width of a <col> element


Propriedades globais

tag <col> suporta propriedades globais HTML .


Propriedades de evento

tag <col> suporta propriedades de evento HTML .