English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Questa guida introduce l'uso dell'attributo span del <colgroup> in HTML, con esempi pratici di come utilizzarlo, compatibilità dei browser, definizione della sintassi e dettagli delle proprietà.
Utilizzare l'attributo span del <colgroup> per impostare il colore di sfondo delle prime due colonne:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML <colgroup> span proprietà utilizzo-Base guida(oldtoolbag.com)</title> <style>table, th, td { border: 1px solid black;}</style> </head> <body> <table> <colgroup span="2" style="background:red"></colgroup> <tr> <th>ISBN</th> <th>Title</th> <th>Prezzo</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>Prova a vedere ‹/›
IEFirefoxOperaChromeSafari
Tutti i browser mainstream supportano l'attributo span.
L'attributo span definisce il numero di colonne che l'elemento <colgroup> deve coprire.
Suggerimento:Per definire attributi diversi per le colonne all'interno di <colgroup>, utilizzare l'etichetta <colgroup> all'interno di <col> etichetta.
Nessuna.
<colgroup span="number">
Valore | Descrizione |
---|---|
number | Impostare il numero di colonne che il gruppo colonne deve coprire. |