Lesson 10 - Tables continued...

Changing the look of your table
You can change the appearance of your table by making each cell a different colour or changing the border size and colour.

If you just type <table>, then by default the table will have no border. If you want to make your table stand out you can add a border by typing <table border="1">. This will make a thin border appear around your table, as you can see below:

the border size 1

To change the colour of the border, you use a similar code to changing background colour. Simply type <table border="1" bordercolor="red"> to make a table with a thin red border. You can either use hexadecimal codes or type in the names of common colours. It will look something like this:

the border colour is red

Changing the colour of the table
Changing the colour of a table is very simple. When you start a table, you just need to say what colour you want the table to be. In this case, I want a light blue (CCCCFF)table, so I type <table border="1" bgcolor="CCCCFF">

background colour is CCCCFF


If you want to change the colour of just one row or cell, you type bgcolor="CCCCFF" inside the start td or tr tag, like so:

<tr bgcolor="CCCCFF">
<td bgcolor="CCCCFF">

Now you can change the appearance of your table to look exactly as you want it.

Go to Previous Lesson Go to Next Lesson






ADVERTISEMENT