Adding
color to an entire table.
Here's a table now...
| Did anyone see my grilled cheese sandwich?
I've been looking for it all afternoon. |
| Grilled cheese is yummy. |
Use the attribute bgcolor="" at
the beginning of your table tag to add color to the whole
table. The code looks like this (I'm not including the whole
table code , just what you need):
<table width="260" height="42"
border="1" align="center" bgcolor="#CCCCFF">
Adding color to table cells
Did anyone see my grilled cheese
sandwich?
I've been looking for it all afternoon. |
| Grilled cheese is yummy. |
We can color cells selectively by using bgcolor=""
in a cell <td></td> of our table.
Notice it's the same background color tag used above, but
this time, we left the table tag alone and just added the
color to the cells. The code for the whole table looks like
this:
<table width="425"
border="1" align="center">
<tr>
<td bgcolor="#CCCCFF"> Did anyone see my grilled
cheese sandwich? <br>
I've been looking for it all afternoon.</td>
</tr>
<tr>
<td bgcolor="#FFFF99">Grilled cheese is yummy.</td>
</tr>
</table>
Adding An Image To The Background Of A Table
Just like adding color, we can add an image to the background
of a table or to the individual cells.
To do this, we use the background=""
attribute.
Did anyone see my grilled cheese sandwich?
I've been looking for it all afternoon. |
| Grilled cheese is yummy. |
<table width="384"
height="93" border="1" align="center"
background="images/greyfish.gif">
In the example above, I used an image that's larger than the
table so it wouldn't repeat all over the place.
In the example below, where I'm adding an image only to a
cell, not the whole table, I've purposely used a small image
so you can see how annoying it gets when it repeats.
Did
anyone see my grilled cheese sandwich?
I've been looking for it all afternoon. |
| Grilled cheese is yummy. |
<table width="425"
border="1" align="center">
<tr>
<td background="images/fish.gif"> <font
color="#FFFFFF">
<strong>Did anyone see my grilled cheese
sandwich? <br>
I've been looking for it all afternoon.</strong></font></td>
</tr>
<tr>
<td bgcolor="#FFFF99">Grilled cheese is yummy.</td>
</tr>
</table>
Now, let's move on to text
and fonts...
If you'd like us to alert you when new tutorials arrive,
join our email list (on the menu to the left)
You can email us at
Sorry, no individual questions answered,
though we may use yours as the basis for a new article.
©2007 www.WebsiteBeginner.com
|