HTML <td> bgcolor Attribute Last Updated : 22 Dec, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report The HTML <td> bgcolor attribute is used to specify the background color of a table cell. It basically, Specify the background color with a hexadecimal code for precise coloring and offers limited color choices compared to modern CSS styling. Note: It is not supported by HTML5. Syntax:<td bgcolor= "color_name | hex_number | rgb_number">Attribute Values:Attribute values Description color_name It sets the text color by using the color name. For example "red". hex_number It sets the text color by using the color hex code. For example "#0000ff". rgb_number It sets the text color by using the rgb code. For example: "RGB(0, 153, 0)". Example: In this example, we will see the implementation of the <td> bgcolor Attribute with an example. html <!DOCTYPE html> <html> <head> <title>HTML <td> bgcolor Attribute</title> </head> <body> <h1>GeeksforGeeks</h1> <h2>HTML td bgcolor Attribute</h2> <table width="500" border="1"> <tr> <th>NAME</th> <th>AGE</th> <th>BRANCH</th> </tr> <tr> <td bgcolor="green">BITTU</td> <td bgcolor="red">22</td> <td bgcolor="yellow">CSE</td> </tr> <tr> <td bgcolor="yellow">RAKESH</td> <td bgcolor="green">25</td> <td bgcolor="red">EC</td> </tr> </table> </body> </html> Output: OutputExample: In this example, we will see the implementation of the <td> bgcolor Attribute with another example. HTML <!DOCTYPE html> <html> <body> <center> <h1 style="color: green;"> GeeksforGeeks </h1> <h3 style="color:darkcyan;font-weight:bold;"> Table Cell Background Color </h3> <table border="1"> <tr> <td bgcolor="lightblue"> Cell 1 </td> <td bgcolor="lightcoral"> Cell 2 </td> <td bgcolor="lightgreen"> Cell 3 </td> </tr> </table> </center> </body> </html> Output: Output Supported Browsers:Google Chrome 1 and aboveMicrosoft Edge 12 and aboveFirefox 1 and aboveOpera 12.1 and aboveSafari 1 and aboveHTML is the foundation of webpages, is used for webpage development by structuring websites and web apps.You can learn HTML from the ground up by following this HTML Tutorial and HTML Examples. HTML <td> bgcolor Attribute Comment More infoAdvertise with us Next Article HTML bgcolor Attribute J jit_t Follow Improve Article Tags : Web Technologies HTML HTML-Attributes Similar Reads HTML <th> bgcolor Attribute The bgcolor attribute in the HTML <th> (table header) tag is used to set the background color of a table header cell. You can specify colors using color names, hexadecimal codes, or RGB values. Note: It is not supported by HTML5. Syntax:<th bgcolor="color_name | hex_number | rgb_number"> 2 min read HTML <tr> bgcolor Attribute The HTML <tr> bgcolor Attribute is used to specify the background color of a table row. This attribute accepts color values such as color names, hex codes, or RGB values, allowing for easy customization of the background color for individual rows in an HTML table.Note: It is not supported by H 2 min read HTML | <tbody> bgcolor Attribute The HTML tbody bgcolor Attribute is used to specify the background color of a table body(tbody). It is not supported by HTML 5. Syntax: <tbody bgcolor= "color_name | hex_number | rgb_number"> Attribute Values: color_name: It sets the text color by using the color name. For example "red". hex_n 1 min read HTML <table> bgcolor Attribute 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 websites to quickly style table elements without depending on CSS. Although modern best practices recommend using CSS for styling, understandin 1 min read HTML | <tfoot> bgcolor Attribute The HTML <tfoot> bgcolor Attribute is used to specify the background color of a foot of the table. It is not supported by HTML 5. Syntax: <tfoot bgcolor= "color_name | hex_number | rgb_number"> Attribute Values: color_name: It sets the text color by using the color name. For example "red 1 min read HTML <col> bgcolor Attribute The HTML <col> element bgcolor attribute was used in HTML to set background colors for table columns. It is deprecated in HTML 4.01 and not supported in HTML5. Instead, CSS should be used to style table columns with the background-color property. Syntax: <col bgcolor= "color_name | hex_numb 2 min read Like We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our Cookie Policy & Privacy Policy Got It ! Improvement Suggest changes Suggest Changes Help us improve. Share your suggestions to enhance the article. Contribute your expertise and make a difference in the GeeksforGeeks portal. Create Improvement Enhance the article with your expertise. Contribute to the GeeksforGeeks community and help create better learning resources for all. Suggest Changes min 4 words, max Words Limit:1000 Thank You! Your suggestions are valuable to us. What kind of Experience do you want to share? Interview Experiences Admission Experiences Career Journeys Work Experiences Campus Experiences Competitive Exam Experiences