このページはコミュニティーの尽力で英語から翻訳されました。MDN Web Docs コミュニティーについてもっと知り、仲間になるにはこちらから。

View in English Always switch to English

HTMLTableElement: 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.

bgcolorHTMLTableElement のプロパティで、この表の背景色を表します。

メモ: この属性は使用しないでください。代わりに、 CSS の background-color プロパティをその要素の style オブジェクトで変更するか、スタイルルールを使用するかしてください。

色の値を表す文字列です。

js
// 表の背景色をライトブルーに設定
const t = document.getElementById("TableA");
t.bgColor = "lightblue";

仕様書

仕様書
HTML
# dom-table-bgcolor

ブラウザーの互換性

関連情報