HTML <col> tag
Esempi
<COLGROUP> e <col> tag per le tre colonne della tabella impostare il colore di sfondo:
<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>
<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>
Prova »
Supporto per il browser
Tutti i browser principali supportano <col> tag.
le definizioni e le istruzioni tag
<Col> tag specifica <colgroup> colonna attributi per ogni elemento della colonna all'interno.
Utilizzando tag <col>, è possibile applicare uno stile di un'intera colonna, anziché richiedere ripetuta per ogni cella in ogni riga o impostare lo stile.
Le differenze tra HTML 4.01 e HTML5
HTML5 più supportato in HTML 4.01 nella maggior parte delle proprietà.
Le differenze tra HTML e XHTML
In HTML, <col> tag non ha alcun tag di chiusura.
In XHTML, <col> tag deve essere ben chiuso.
proprietà
属性 | 值 | 描述 |
---|---|---|
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 |
Proprietà globali
<Col> tag supporta HTML proprietà globali .
Proprietà evento
<Col> tag supporta proprietà dell'evento HTML .