When creating tables using the theme_table function, the default method to turn off table striping is to add the no_striping option row by row:
$rows[] = array('data' => array(...), 'no_striping' => TRUE);

When using Bootstrap, however, the table-striped class is always added to the table. I would like to propose that users add the no_striping class to a table when striping is not desired (since it usually is, I think making striping by default is good):
theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('class' => 'no_striping')));

Please see attached patch, where bootstrap_preprocess_table is modified to look for this class before adding the table-striped class.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

MD3’s picture

wundo’s picture

Status: Needs review » Fixed

Commited! :)

But I'm using the following class to toggle no stripping: table-no-striping

MD3’s picture

Awesome! Thanks so much!

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

sobi3ch’s picture

Issue summary: View changes

There is now other class to do it table-no-striping. So just theme table like this:

  return theme('table',  array(
    'header' => $headers, 
    'rows'=> $rows,
    'attributes' => array('class' => 'table-no-striping')
  ));