|
Set the background colour of a table cell with CSS |
|
Saturday, 10 December 2005 |
|
Set the background colour of a table cell with CSS This tutorial with guide you through how to set the background colour of a table cell using CSS
| 1. | In your CSS file, type # followed by whatever you want to call the table cell. eg #table1back |
| 2. | Now put in a { and type background-color:#000000; but replace 000000 with whichever colour you want to use and close with } |
| 3. | Now we should have: #table1back { background-color:#000000; } |
| 4. | Now for your tables code in the <td> tag add id="tableback1" |
| 5. | Now we have our CSS code and our table set up. This should be your complete code: Head Section or CSS File: #table1back { background-colour:#000000; } Table Code: <table> <tr> <td id="table1back">Table Background 1</td> </tr> </table> Example: |
|