Latest web development tutorials

HTML attribut tr bgcolor

Manuel tag de référence de HTML HTML balise <tr>

Exemples

Pour la première ligne de la table ajouter une couleur d'arrière-plan:

<table border="1">
<tr bgcolor="#FF0000">
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>$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 <tr> attribut bgcolor. Utilisez CSS à la place.

Dans HTML 4.01, <tr> l'attribut bgcolor obsolète .

attribut bgcolor spécifie la couleur des lignes de la table de fond.


notes de compatibilité

Dans HTML 4.01, <tr> l'attribut bgcolor obsolète. Utilisez CSS à la place.

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

CSS Exemple: Ajouter une couleur de fond à la table rangée

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


grammaire

<tr 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)")。


Manuel tag de référence de HTML HTML balise <tr>