Il tag HTML <col>



Descrizione

Il tag HTML <col> permette di raggruppare attributi per le colonne. Esso non raggruppa le colonne strutturalmente, come fa l' elemento colgroup.

È un elemento vuoto che serve solo da supporto per gli attributi.

Esempio

<!DOCTYPE html>
<html>
<head>
<title>HTML col Tag</title>
</head>
<body>
<p>This example shows a colgroup that has three columns of different widths:</p>
<table border="1">
<colgroup span="3">
<col width="50"></col>
<col width="100"></col>
<col width="150"></col>
<col width="50"></col>
</colgroup>
<tr>
<td>col 1</td>
<td>col 2</td>
<td>col 3</td>
<td>col 4</td>
</tr>
</table>
</body>
</html>

Produrrà il seguente risultato:

This example shows a colgroup that has three columns of different widths:

col 1 col 2 col 3 col 4

Attributi Globali

Questo tag supporta tutti gli attributi globali descritti in - HTML - Referenze Attributi

Attributi Specifici

The HTML <col> supporta anche i seguenti attributi aggiuntivi:

AttributoValoreDescrizione
align right
left
center
justify
char
Definisce l' allineamento, non supportato in Html5.
char character Definisce un carattere da cui allineare il testo (usato con align="char"), non supportato in Html5.
charoff pixelSpecifica l' offset contro cui allineare il primo carattere come specificato dall' attributo char, non supportato in Html5.
span numericoDefinisce il numero di colonne, non supportato in Html5.
valign bottom
middle
top
baseline
Definisce l' allineamento verticale, non supportato in Html5/i>.
width pixels o %Definisce la larghezza di ogni colonna, non supportato in Html5 .

Attributi Evento

Questo tag supporta tutti gli attributi evento descritti in - HTML - Referenze Eventi

Compatibilità Browser

ChromeFirefoxIEOperaSafariAndroid
SiSiSiSiSi?
html_tags_reference.htm
Advertisements