HTML th Attribut bgcolor
Beispiele
Tabellenkopf Zelle eine Hintergrundfarbe hinzuzufügen:
<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>
Versuchen »
Browser-Unterstützung
Alle gängigen Browser unterstützen das Attribut bgcolor.
Definition und Verwendung
HTML5 unterstützt nicht die <th> bgcolor - Attribut. Verwenden Sie CSS statt.
In HTML 4.01, <th> das Attribut bgcolor obsolet .
bgcolor-Attribut legt die Hintergrundfarbe der Kopfzelle.
Hinweise zur Kompatibilität
In HTML 4.01, <th> das Attribut bgcolor obsolet. Verwenden Sie CSS statt.
CSS Syntax: <th style = "background-color: red">
CSS Beispiel: eine Header - Zelle Hintergrundfarbe hinzufügen
In unserem CSS Tutorial können Sie weitere Informationen über die finden background-color - Attribut Details.
Grammatik
<th bgcolor="color_name|hex_number|rgb_number">
Eigenschaft Wert
值 | 描述 |
---|---|
color_name | 规定颜色值为颜色名称的背景颜色(比如 "red")。 |
hex_number | 规定颜色值为十六进制值的背景颜色(比如 "#ff0000")。 |
rgb_number | 规定颜色值为 rgb 代码的背景颜色(比如 "rgb(255,0,0)")。 |
HTML <th> -Tag