Color - Web APIs - MDN Web Docs
Có thể bạn quan tâm
- Skip to main content
- Skip to search
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time.
The bgcolor property of the HTMLTableElement represents the background color of the table.
Note: Do not use this attribute anymore. Instead, use the CSS background-color property by modifying the element's style attribute or using a style rule.
In this article
- Value
- Examples
- Specifications
- Browser compatibility
- See also
Value
A string representing a color value.
When set to the null value, that null value is converted to the empty string (""), so elt.bgColor = null is equivalent to elt.bgColor = "".
Examples
js// Set table background color to lightblue const t = document.getElementById("TableA"); t.bgColor = "lightblue";Specifications
| Specification |
|---|
| HTML# dom-table-bgcolor |
Browser compatibility
See also
- background-color
Help improve MDN
Was this page helpful to you? Yes No Learn how to contributeThis page was last modified on Jul 26, 2024 by MDN contributors.
View this page on GitHub • Report a problem with this content Filter sidebar- The HTML DOM API
- HTMLTableElement
- Instance properties
- align Deprecated
- bgColor Deprecated
- border Deprecated
- caption
- cellPadding Deprecated
- cellSpacing Deprecated
- frame Deprecated
- rows
- rules Deprecated
- summary Deprecated
- tBodies
- tFoot
- tHead
- width Deprecated
- Instance methods
- createCaption()
- createTBody()
- createTFoot()
- createTHead()
- deleteCaption()
- deleteRow()
- deleteTFoot()
- deleteTHead()
- insertRow()
- Inheritance
- HTMLElement
- Element
- Node
- EventTarget
- Related pages for HTML DOM
- BeforeUnloadEvent
- DOMStringMap
- ErrorEvent
- HTMLAnchorElement
- HTMLAreaElement
- HTMLAudioElement
- HTMLBRElement
- HTMLBaseElement
- HTMLBodyElement
- HTMLButtonElement
- HTMLCanvasElement
- HTMLDListElement
- HTMLDataElement
- HTMLDataListElement
- HTMLDialogElement
- HTMLDivElement
- HTMLDocument
- HTMLElement
- HTMLEmbedElement
- HTMLFieldSetElement
- HTMLFormControlsCollection
- HTMLFormElement
- HTMLFrameSetElement Deprecated
- HTMLHRElement
- HTMLHeadElement
- HTMLHeadingElement
- HTMLHtmlElement
- HTMLIFrameElement
- HTMLImageElement
- HTMLInputElement
- HTMLLIElement
- HTMLLabelElement
- HTMLLegendElement
- HTMLLinkElement
- HTMLMapElement
- HTMLMediaElement
- HTMLMenuElement
- HTMLMetaElement
- HTMLMeterElement
- HTMLModElement
- HTMLOListElement
- HTMLObjectElement
- HTMLOptGroupElement
- HTMLOptionElement
- HTMLOptionsCollection
- HTMLOutputElement
- HTMLParagraphElement
- HTMLPictureElement
- HTMLPreElement
- HTMLProgressElement
- HTMLQuoteElement
- HTMLScriptElement
- HTMLSelectElement
- HTMLSourceElement
- HTMLSpanElement
- HTMLStyleElement
- HTMLTableCaptionElement
- HTMLTableCellElement
- HTMLTableColElement
- HTMLTableRowElement
- HTMLTableSectionElement
- HTMLTemplateElement
- HTMLTextAreaElement
- HTMLTimeElement
- HTMLTitleElement
- HTMLTrackElement
- HTMLUListElement
- HTMLUnknownElement
- HTMLVideoElement
- HashChangeEvent
- History
- ImageData
- Location
- MessageChannel
- MessageEvent
- MessagePort
- Navigator
- PageRevealEvent
- PageSwapEvent
- PageTransitionEvent
- Plugin Deprecated
- PluginArray Deprecated
- PromiseRejectionEvent
- RadioNodeList
- TimeRanges
- UserActivation
- ValidityState
- Window
- WorkletGlobalScope
- Guides
- Using microtasks in JavaScript with queueMicrotask()
- In depth: Microtasks and the JavaScript runtime environment
Từ khóa » Html Bgcolor Tag
-
HTML | Bgcolor Attribute - GeeksforGeeks
-
HTML Bgcolor Attribute - GeeksforGeeks
-
HTML Colors - W3Schools
-
How To Set Background Color In HTML? - Tutorialspoint
-
HTML Background-color - Javatpoint
-
HTML - Bgcolor - Tizag Tutorials
-
How To Add & Change Background Color In HTML - HubSpot Blog
-
HTML Background Color - HTML Color Codes
-
HTML Body Bgcolor Attribute - W3Schools
-
» - HTML"> » - HTML
-
Why Table Bgcolor Is No Longer Valid Code (And What To ... - HTML
-
HTML Tutorial - Bgcolor,colors For Background, Inserting A Picture On ...
-
HTML Background Color - Set And Change - STechies