Created
November 19, 2015 16:40
-
-
Save apperceive/01502800b222a2804cc0 to your computer and use it in GitHub Desktop.
add Twitter bootstrap Table Class to Drupal 7 theme table
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function THEMENAME_preprocess_table(&$variables) { | |
if(!isset($variables['attributes']['class'])) { | |
$variables['attributes']['class'] = array('table', 'table-striped'); | |
} | |
else { | |
$variables['attributes']['class'][] = 'table'; | |
$variables['attributes']['class'][] = 'table-striped'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from http://www.lightrains.com/blog/add-twitter-bootstrap-table-class-drupal-7-theme-table