I noticed that drupal always use grey as background and line color with tables.

I prefer to avoir modifying the code of my template. Is there any way to modify the ugly grey drupal tables ?

  • write your own css style colors – Aboodred1 May 29 '13 at 16:39
  • Thanks but where do I put the css style (I don't want to modify the template) ? – Ben May 29 '13 at 18:14

There are a couple of ways to do it. Here are two of them:

Through your theme

  • write your own mainstyle.css file.
  • place it in your active theme directory (directly or in a folder that you create there)
  • go to that theme directory and open the file: [themename].info (e.g. bartik.info or myAwesomeTheme.info)
  • add stylesheets[all][] = mainstyle.css after the existing stylesheets. (or stylesheets[all][] = css/mainstyle.css if your stylesheet is placed in a folder called 'css').
  • flush your cache

This way drupal will include your stylesheet.

A simpler way to do it , with the help of a module, so that you don't touch any of your files, is

  • download the module css injector
  • enable the module
  • go to configuration -> development -> css injector (admin/config/development/css-injector)
  • create a new rule and give a name to the rule: e.g. table styling
  • Finally in this rule write your CSS e.g. td {background-color: red;} etc

Tip: If you want to target your elements (e.g. tables) correctly, then you may need firebug, which is an extension for Firefox.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.