Latest web development tutorials

HTML attribut td bgcolor

HTML manuel td tag de référence HTML balise <td>

Exemples

Ajouter une couleur de fond aux cellules:

<table border="1">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td bgcolor="#FF0000">January</td>
<td bgcolor="#00FF00">$100</td>
</tr>
</table>

Essayez »

support du navigateur

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Tous les principaux navigateurs prennent en charge l'attribut bgcolor.


Définition et utilisation

HTML5 ne supporte pas la balise <td> attribut bgcolor. Utilisez CSS à la place.

Dans HTML 4.01, <td> Le bgcolor attribut obsolète .

attribut bgcolor spécifie la couleur de la cellule du tableau de fond.


notes de compatibilité

Dans HTML 4.01, <td> Le bgcolor attribut obsolète. Utilisez CSS à la place.

Syntaxe CSS: <td style = "background-color: red">

CSS Exemple: pour ajouter de la couleur de la cellule de tableau de fond

Dans notre tutoriel CSS vous pouvez trouver plus d' informations sur les background-color attribut détails.


grammaire

<td 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 manuel td tag de référence HTML balise <td>