Is there a way to style table in the following manner with CSS?
I want to define individual properties for each column of a table. i.e. Same bgcolor, padding, alignment. This, to me , seems problematic. It would be easier to style whole rows than whole columns because rows are contained in the same <tr> tag, while columns are not.
The only alternative I can think of (which I'd like tog et away from) is setting a unique class for each <td> cell that comprises the column.
Is there any other way to do this?
BTW (my table is for tabular data, not layout!)
Styling Tables effectively
Unless you want to set the column cells individually, I'd use a script to do the dirty work. See this table. The basic table was built with PHP/Mysql (this page is the static output), and is dynamic in the client by way of javascript. Click on a column header to see the column change color. Don't ask for help on the script , where js is concerned, I'm a cut and paste kinda guy.
cheers,
gary