Deprecated in HTML5. Do not use.

<table bgcolor="">
HTML attribute

Attribute of
<table>
What does <table bgcolor=""> do?
Was used to set the background color of an HTML table. This attribute has been deprecated. Use CSS to style tables.

Code Example

<table bgcolor="#ccccff">
  <tr><td>First column</td><td>Second column</td><td>Third column</td></tr>
  <tr><td>First column</td><td>Second column</td><td>Third column</td></tr>
  <tr><td>First column</td><td>Second column</td><td>Third column</td></tr>
</table>
First columnSecond columnThird column
First columnSecond columnThird column
First columnSecond columnThird column

Styling Table Background Colors

The bgcolor was once the correct way to specify the color to be applied to the background of a table. However, this attribute has been deprecated in favor or using CSS to style tables. The attribute does still work in most browsers and can accept color names, hex color codes, and rgb values. To set the background of a table with CSS, use the background-color property instead of the bgcolor HTML attribute.

<style> table.example-table {   background-color: #ccccff; } </style> <table class="example-table">   <tr><td>First column</td><td>Second column</td><td>Third column</td></tr>   <tr><td>First column</td><td>Second column</td><td>Third column</td></tr>   <tr><td>First column</td><td>Second column</td><td>Third column</td></tr> </table> 
First column Second column Third column
First column Second column Third column
First column Second column Third column