HTMLTableCellElement: bgColor プロパティ
Deprecated
Avoid using this feature in new projects. Some table styling attributes have no effect. They are superseded by CSS. This feature may be a candidate for removal from web standards or browsers.>
The HTMLTableCellElement.bgColor property is used to set the background color of a cell or get the value of the obsolete bgColor attribute, if present.
メモ:
このプロパティは非推奨となっており、背景色の設定には CSS を使用すべきです。代わりに background-color プロパティを使用してください。
値
以下の値型のどちらかを使用できます。
- 名前付き色、たとえば
redやblue - 16 進コード、たとえば,
#0000ddや#00d
メモ:
ここで受け入れられる値は、CSS の色値の一部に限定されています。<named-color> および 3 桁または 6 桁の <hex-color>(アルファチャンネルなし)のみが使用可能です。CSS ではすべての HTML 色値が有効ですが、その逆は当てはまりません。
例
代わりに CSS の background-color を使用してください。HTML の表要素で background-color を使用する例 は、background-color ページにあります。
仕様書
| 仕様書 |
|---|
| HTML> # dom-tdth-bgcolor> |