This documentation is archived and is not being maintained.

HtmlTableRow::BgColor Property

Gets or sets the background color of the row represented by an instance of the HtmlTableRow class.

Namespace:  System.Web.UI.HtmlControls
Assembly:  System.Web (in System.Web.dll)

public:
property String^ BgColor {
	String^ get ();
	void set (String^ value);
}
<asp:HtmlTableRow BgColor="String" />

Property Value

Type: System::String
The background color of the row represented by an instance of HtmlTableRow.

Use the BgColor property to specify the background color of the row represented by an instance of the HtmlTableRow class. You can specify a color either by name or by using a hexadecimal value, preceded by the pound character (#), in the form #RRGGBB. RR, GG, and BB represent hexadecimal values from 0 to 255 that indicate the red, green, and blue components of a color, respectively. For example, the value #0000FF represents the color blue. It specifies the minimum value (00) for the red and green components, while specifying the maximum value (FF) for the blue component.

The following table shows the sixteen predefined HTML color names and corresponding hexadecimal values that can be used for the BgColor property. For more information on HTML colors, see the World Wide Web Consortium (W3C) Web site.

Color name

Hexadecimal value

Aqua

#00FFFF

Black

#000000

Blue

#0000FF

Fuchsia

#FF00FF

Gray

#808080

Green

#008000

Lime

#00FF00

Maroon

#800000

Navy

#000080

Olive

#808000

Purple

#800080

Red

#FF0000

Silver

#C0C0C0

Teal

#008080

White

#FFFFFF

Yellow

#FFFF00

The available colors for use with the BgColor property can be determined from the KnownColor enumeration.

Color names are case-insensitive.

The following code example demonstrates how to use the BgColor property to control the background color of a row in the HtmlTable control.

No code example is currently available or this language may not be supported.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: