HTML th attribut bgcolor
Exemples
tête de tableau cellule pour ajouter une couleur de fond:
<table border="1">
<tr>
<th bgcolor="#FF0000">Month</th>
<th bgcolor="#00FF00">Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
<tr>
<th bgcolor="#FF0000">Month</th>
<th bgcolor="#00FF00">Savings</th>
</tr>
<tr>
<td>January</td>
<td>$100</td>
</tr>
</table>
Essayez »
support du navigateur
Tous les principaux navigateurs prennent en charge l'attribut bgcolor.
Définition et utilisation
HTML5 ne supporte pas le <th> bgcolor attribut. Utilisez CSS à la place.
Dans HTML 4.01, <th> l'bgcolor attribut obsolète .
attribut bgcolor spécifie la couleur de la cellule d'en-tête d'arrière-plan.
notes de compatibilité
Dans HTML 4.01, <th> l'bgcolor attribut obsolète. Utilisez CSS à la place.
Syntaxe CSS: <th style = "background-color: red">
CSS Exemple: pour ajouter une couleur d'arrière - plan en- tête cellulaire
Dans notre tutoriel CSS vous pouvez trouver plus d' informations sur les background-color attribut détails.
grammaire
<th bgcolor="color_name|hex_number|rgb_number">
Valeur de la propriété
值 | 描述 |
---|---|
color_name | 规定颜色值为颜色名称的背景颜色(比如 "red")。 |
hex_number | 规定颜色值为十六进制值的背景颜色(比如 "#ff0000")。 |
rgb_number | 规定颜色值为 rgb 代码的背景颜色(比如 "rgb(255,0,0)")。 |
HTML <th> tag