Why Table Bgcolor Is No Longer Valid Code (And What To ... - HTML
Có thể bạn quan tâm
Skip to content HTML / Create An HTML Table Quickly & Easily With Our Code Example / Why Table Bgcolor Is No Longer Valid Code (And What To Use Instead)Deprecated in HTML5. Do not use.Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn moreAttribute ofCreate An HTML Table Quickly & Easily With Our Code ExampleWhat does Why Table Bgcolor Is No Longer Valid Code (And What To Use Instead) do?Was used to set the background color of an HTML table. This attribute has been deprecated. Use CSS to style tables.
Adam WoodAdam is a technical writer who specializes in developer documentation and tutorials.
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 column | Second column | Third column |
First column | Second column | Third column |
First column | Second column | Third 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> table.example-table{background-color: #ccccff;}First column | Second column | Third column |
First column | Second column | Third column |
First column | Second column | Third column |
Post navigation
How To Use In HTML<td nowrap>Search HTML.com
Search for:Most Popular
- HTML Img Alt Tags For SEO Best Practice - Search Engines Love Them146 views
- <var> HTML Tag75 views
- Input Pattern: Use It To Add Basic Data Validation In HTML516 views
- Using The HTML Tag To Create Inline Frames: Here's How15 views
- What Does In HTML: Easy Tutorial With Code Example11 views
Từ khóa » Html Bgcolor Tag
-
HTML | Bgcolor Attribute - GeeksforGeeks
-
HTML Bgcolor Attribute - GeeksforGeeks
-
HTML Colors - W3Schools
-
How To Set Background Color In HTML? - Tutorialspoint
-
HTML Background-color - Javatpoint
-
HTML - Bgcolor - Tizag Tutorials
-
How To Add & Change Background Color In HTML - HubSpot Blog
-
HTML Background Color - HTML Color Codes
-
HTML Body Bgcolor Attribute - W3Schools
-
» - HTML"> » - HTML
-
Color - Web APIs - MDN Web Docs
-
HTML Tutorial - Bgcolor,colors For Background, Inserting A Picture On ...
-
HTML Background Color - Set And Change - STechies