Section 2 - Basics Section 4 - Advanced Fancy Lists Forms Advanced Tables Color tables Background images Nested tables You try it Frames Style Sheets Image Maps Section 5 - Publishing Section 6 - Extras Appendices |
One trick that is useful when making a table is to make the table stand out by being a different color than the background. Here's how to do that. As you remember, the table consists of the <table> tags, the <tr> tags and the <td> tags. The mosst useful of these tags are the table and table data tags. These can also be modified to have a background color. Let's show you.
Now, let's put a background color on the whole table. To do this, we modify the <table> tag.
You'll notice that the entire table has become yellow, including the borders between the cells. This is a good way to make your table to stand out. If you only want to change the color of one cell, this can be done in the <td> tag. It's done the same way.
Can these tags be combined? Let's make a blue table with yellow squares. This time, I'll show you all of the code together:
This can be used in conjunction with cellpadding, cellspacing and border to modify the appearance of the table. Of course, you can change <td> tags to have different colors. Remember that you can also change the table border with the bordercolor command. The flag I made on the last page is mostly just table data background colors.
|