Hi,
I really like the capabilities of the Adaptivetheme.
In my case, I am using Adaptivetheme 7.x-3.0 & Drupal 7.23.
I would like to turn off odd/even stripping for a couple of tables.
In particular, several tables have a background image while the table cells in the fore ground have text. I would like to turn off row stripping for the tables with background images. The row stripping is nice for tables without background images.
Is there a simple way to control stripping for tables? There probably is, but I am missing it.
I looked at this link (https://drupal.org/node/1911218#comment-7039972), but the patch does not seem to correspond to the current theme.inc file.
Thanks for any assistance,
Ted

Comments

Jeff Burnz’s picture

Depends what is generating the table, if its Views you can control that from within the admin.

If its a module using Drupal cores theme_table function you can approach this three ways - remove odd/even classes on all table rows, try to determine one or more tables and remove odd/even classes just for those tables, or just use CSS.

Unless know PHP, use CSS.

AT will stripe tables even without odd/even classes, this is done using CSS, the idea was to provide consistent row striping for tables added to nodes, say in a WYSIWYG editor:

tr:nth-child(2n+2) {
    background-color: #F5F5F5;
}

So, you can usually target a table, if its in a form almost all forms have an id, nodes have ids etc etc, so you can almost always override striping using CSS also, either with the above nth-child classes or directly using odd/even styling.

If you really want to go hard out and actually remove odd/even classes you can do something like this, if you want to target just a few tables then you have to account for that in code, I can't guess what that might be for your site:

function mytheme_preprocess_table(&$variables) {
  $rows = $variables['rows'];
  foreach ($rows as $number => $row) {
    $variables['rows'][$number]['no_striping'] = TRUE;
  }
}
TJM’s picture

Jeff,
Thanks for the prompt rely.
Since it is just 4 to 5 tables, I have decided to use CSS to remove the strip color for the odd/even stripping of tables.
I have used this css in the table row:

With this css the table's background image is visible.
Thanks again for the great Adaptivetheme.
Ted
Jeff Burnz’s picture

Status: Active » Fixed

Awesome, glad you got it sorted.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.