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 but it doesn't work.


 * with CSS:

 .mytable a { color:green !important; }

.mytable { color:yellow; }
 * -- Weas-El ✉  15:21, September 28, 2011 (UTC)

Sorry, but I don't think that would work, simply because we have tons of tables with different colorschemes and we set the colorscheme through a template, this way we have to edit only the template to affect every object which use that colorscheme. If I have to set a class for every tables, than it's faster set the colors manually, also I don't think I can use wiki text and template in the CSS.

I mean we do somethink like this:

Though a little more complicated...


 * f you don't want to add a specific CSS class to all the tables where you want to modify the link color, then you can be more general about the selector, i.e.



table td a { color:yellow !important; }


 * which will change the link colors for ALL tables on your wiki. You can also be more specific by adding a other selectors to specify which tables you want to colorize. There needs to be a 'hook' for them though - something that distinguishes them from other tables.


 * Generally, using templates just to add styling causes more server strain than just defining it through the wiki style sheets, so the solution Weas-El suggested is in my opinion the better one. — Sovq 16:41, September 28, 2011 (UTC)

If you want an idea how we use the colorschems, see here. We use them for infoboxes, template and other things. Well I guess there isn't any other solution, thank you.