Let’s see how to color the cells.
In the lesson dedicated to rows and columns, we left off here:
Do you remember it? Here’s what we had created:
Now, let’s color the 100px cell, the one at the bottom left, the smallest one:
Here’s the code with the color added to the cell:
With the support of bgcolor, we have given a background color to our small cell. Now let’s color them all with different colors. Let’s see how.
Here is the complete code:
We have effectively colored each individual cell that makes up the table. But what if we wanted to color the table in its entirety? Here’s the code to use:
We have assigned bgcolor to the table tag to color the table in its entirety. Here’s what you’ll get:
Since the table has borders, you will only get the coloring of the borders themselves, as each cell has been assigned a different color.
Pubblicato in HTML & CSS
Be the first to comment