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
- <var> HTML Tag306 views
- What Is Doxing? (And Why Is It So Scary?): An Infographic85 views
- New Audio HTML Element: Master It Out Now With Our Code Example62 views
- The Web Worker's Stress Busting Toolbox: 50 Tips to Improve Your Life43 views
- <meter> HTML Tag41 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