![]() |
|
| |||||||
| Notices |
| CSS Cascading Style Sheets All topics and discussions relating to CSS Cascading Style Sheets. |
![]() |
| | Thread Tools |
|
#1
| ||||
| ||||
|
Hi, I am trying to get a tables with different background colors on the same page. I have got to the stage where I can place “lets say” 4 tables on 1 pages & via the remote css sheet I can change the background colour via the <tb> tag. But how do I make each table a different colour? ----------------------------------------------------------------------------- td { background-color: green } ------------------------------------------------------------------------------- <table border="0" bordercolor="" width="100" > <tr> <s1><td> row 1, column 1 </s1></td> </tr> </table> ------------------------------------------------------------------------------ But not sure what I am doing wrong here. ------------------------------------------------------------------------------- b1 { background-color: red } <table border="0" bordercolor="" width="100" > <tr> <b1><td> row 1, column 1 </b1></td> </tr> </table> ---------------------------------------------------------------------------------------------------------- Thanks.
__________________ Regards Chris, Sites are view in FF & IE, with res @ 1024 x 768 on 19” screens. Barnet walks How to ask for help on the forum. - VH prices. - BV Tutorials. - Using PIXresizer - Image/Photo Tips - Collectables, Collecting |
|
#2
| ||||
| ||||
|
Your going to want to define a css class for each table Your css sheet will be something like .table1 { background-color: #00FF00; } .table2 { background-color:#0000CC; } .table3 { background-color:#FFFF00; } And then your tables html will be this <table class="table1" width="100"> <tr><td>This has a backgrond</td></tr> </table> <table class="table2" width="100"> <tr><td>This has a different background</td></tr> </table> <table class="table3" width="100"> <tr><td>As does this</td></tr> </table> Further, you will probably want to go ahead and define the tables width in the css file as well, instead of the tables html code itself. ( width: 100px )
__________________ Register/Login Script Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script |
|
#3
| ||||
| ||||
|
Many, many thanks Watdaflip. I have been playing already. That saved me a lot of time. http://www.collectors-info.com/testing/css/cssbg.php
__________________ Regards Chris, Sites are view in FF & IE, with res @ 1024 x 768 on 19” screens. Barnet walks How to ask for help on the forum. - VH prices. - BV Tutorials. - Using PIXresizer - Image/Photo Tips - Collectables, Collecting |
|
#4
| ||||
| ||||
|
Your welcome, any time.
__________________ Register/Login Script Do you use a Password Protected Directory? Need a way to allow users to make their own account, try my .htaccess Login Script |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| |