![]() |
VOOZH | about |
The bgcolor attribute in HTML <table> tag was previously used to set the background color of a table. It was once generally used in over 60% of legacy websitesto quickly style table elements without depending on CSS. Although modern best practices recommend using CSS for styling, understanding bgcolor remains important for maintaining or updating older web projects where inline attributes are still present.
Syntax
<table bgcolor="color_name | hex_number | rgb_number">
Attribute Values
Note: The <table> bgcolor Attribute is not supported by HTML 5. Instead of using this, we can use the CSS background-color property.
Example:
Output
| Attribute | 👁 Chrome | 👁 Edge | 👁 Firefox | 👁 Safari | 👁 Opera |
|---|---|---|---|---|---|
| <table> bgcolor | ✓ | ✓ | ✓ | ✓ | ✓ |
| Desktop | v1 | v12 | v1 | v1 | v15 |
| Mobile | v18 | ‐ | v4 | v1 | v14 |