Forum:Table design with CSS

Is it possible to define different styles for each table column without adding every cell to a style class?

Example: An easy solution is and defining the colors in the used style classes.

But is it possible to define this table design using only a single class for the  tag? Like this: Thanks in advance. -- Weas-El ✉  22:10, September 27, 2011 (UTC)


 * Yes, this is possible by using the nth-child pseudo-class. So for your example

 table.weas-el-table-example td:nth-child(odd) { background-color: yellow; }

table.weas-el-table-example td:nth-child(even) { background-color: red; }
 * should do the job. — Sovq 05:09, September 28, 2011 (UTC)