Mozilla.com

  1. MDC
  2. Main Page
  3. DOM
  4. table.bgColor

« Gecko DOM Reference

Summary

Deprecated

bgcolor gets/sets the background color of the table.

Syntax

color = table.bgColor
table.bgColor = color

Parameters

  • color is a string representing a color value.

Example

// Set table background colour to lightblue
var t = document.getElementById('TableA');
t.bgColor = 'lightblue';

Notes

The bgColor attribute is deprecated in HTML 4.01. The CSS:background-color property should be used instead by modifying the element's style object or using a style rule.

Also available on DOM tbody, row and cell objects.

Page last modified 23:13, 22 Sep 2006 by LouCypher

Files (0)