In Action

Using the HTML bgcolor tag with tables

HTML bgcolor tag. Using the bgcolor tag within the table and tr tags.

Background color is cyan
row #1
row #2

Background color set by row
row #1
row #2


Toycode

HTML Code

Just cut-n-paste to reuse.

     
<table border="1" cellspacing="0" bgcolor="#00ffff">
  <th>Background color is cyan</th>
  <tr>
    <td>row #1 </td>
  </tr>
  <tr>
    <td>row #2 </td>
  </tr>
</table>

<br>

<table border="1" cellspacing="0" bgcolor="green">
  <th>Background color set by row</th>
  <tr bgcolor="red">
    <td>row #1 </td>
  </tr>
  <tr bgcolor="blue">
    <td>row #2 </td>
  </tr>
</table>