PDA

View Full Version : Tables, CSS & Columns


topdog
03-18-2009, 04:23 PM
Is it possible, using CSS to have each column in a table a different colour. i.e. Column 1 blue with white text, column 2 white with blue text and column three green with yellow text?

And, if so, how?

Thanks

coloeagle
03-18-2009, 04:50 PM
Yes it is possible.

Define a different css class or id to each column.

topdog
03-18-2009, 05:12 PM
I am not sure just how to do that - any further assistance would be appreciated.

Brian

coloeagle
03-18-2009, 05:32 PM
In your css you would have,

.column1 {
background-color:#???;
color:#???;
}
.column2 {
background-color:#???;
color:#???;
}
.column3 {
background-color:#???;
color:#???;
}
Then assign the relative class to the columns.

coloeagle
03-18-2009, 06:02 PM
I have thrown together a page without tables with 3 columns as you described.

Hope this helps.

http://validwebdesigns.com/construction/columns.htm

topdog
03-18-2009, 06:07 PM
Now that is just beautiful.

Thanks for your help

Brian

coloeagle
03-18-2009, 06:16 PM
Your welcome,

Just curious are you using the tables for data or for design/layout?

topdog
03-18-2009, 06:21 PM
For data to present information for forthcoming events. I am currently rewriting a site with CSS instead of relying on a template. www.canadianrallyo.ca. GO the trials and then the current trials to see what I am going to present in a different format.

Does it make much difference?

coloeagle
03-18-2009, 06:30 PM
Nice site, :)

As for a difference, just that tables should be used for data and not design.

Sounds like you are going about things properly :mrgreen:

Jody

topdog
03-18-2009, 06:32 PM
Thanks - too much to learn - too little time

Brian