HTML Table Background Color

 

HTML Table Background Color

 

The HTML table tag is the opening tag used to create a table within a web page.

To add color to your HTML table cells, add bgcolor="#color code" within the <td> tag.

HTML Code
HTML code viewed within an HTML document:
html-line

<table cellpadding="2" cellspacing="2" width="50%">
<tr>
<td bgcolor="#eeeeee">Column 1</td>
<td bgcolor="#eeeeee">Column 2</td>
</tr>
<tr>
<td>Row 2</td>
<td>Row 2</td>
</tr>
</table>

Browser View
HTML coding viewed through a web browser:
html-line

Column 1 Column 2
Row 2 Row 2
HTML Code
HTML code viewed within an HTML document:
html-line

<table cellpadding="2" cellspacing="2" width="50%">
<tr>
<td bgcolor="#ffff00">Your Text</td>
</tr>
</table>

Browser View
HTML coding viewed through a web browser:
html-line

Your Text
HTML Code
HTML code viewed within an HTML document:
html-line

<table cellpadding="2" cellspacing="2" width="50%">
<tr>
<td bgcolor="#80ffff">Your Text</td>
</tr>
</table>

Browser View
HTML coding viewed through a web browser:
html-line

Your Text
HTML Code
HTML code viewed within an HTML document:
html-line

<table cellpadding="2" cellspacing="2" width="50%">
<tr>
<td bgcolor="#80ff80">Your Text</td>
</tr>
</table>

Browser View
HTML coding viewed through a web browser:
html-line

Your Text
HTML Code
HTML code viewed within an HTML document:
html-line

<table cellpadding="2" cellspacing="2" width="50%">
<tr>
<td bgcolor="#ffc0c0">Your Text</td>
</tr>
</table>

Browser View
HTML coding viewed through a web browser:
html-line

Your Text
HTML Code
HTML code viewed within an HTML document:
html-line

<table cellpadding="2" cellspacing="2" width="50%">
<tr>
<td bgcolor="#c0c0ff">Your Text</td>
</tr>
</table>

Browser View
HTML coding viewed through a web browser:
html-line

Your Text
HTML Code
HTML code viewed within an HTML document:
html-line

<table cellpadding="2" cellspacing="2" width="50%">
<tr>
<td bgcolor="#ffc0ff">Your Text</td>
</tr>
</table>

Browser View
HTML coding viewed through a web browser:
html-line

Your Text
HTML Code
HTML code viewed within an HTML document:
html-line

<table cellpadding="2" cellspacing="2" width="50%">
<tr>
<td bgcolor="#cccccc">Your Text</td>
</tr>
</table>

Browser View
HTML coding viewed through a web browser:
html-line

Your Text

You can change the table background color to whatever you’d like, but keep in mind, the text must be visible through the background color.

You can learn much more about HTML tables within the HTML Tutorial section.

This concludes the HTML Table Background Color code.
 

 

 
Visit the following pages for a wealth of copy and paste codes and tips:

HTML Tips
Copy and paste special effect HTML codes for your web page.

HTML Codes
An HTML codes chart you can use to copy and paste codes into your web page.

HTML Color Codes
An HTML color codes chart you can use to copy and paste color codes into your web page.

JavaScript Codes
Copy and paste special effect JavaScript codes for your web page.

Web Design Tips
Tips, tricks, and special effect codes for your web page.

HTML Tags
A list of HTML tags.

HTML 5 Tags
A list of the latest HTML tags to be developed.

ASCII Codes
Special text characters and code for your web page.