diff options
author | Dries Buytaert <dries@buytaert.net> | 2007-04-09 13:43:57 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2007-04-09 13:43:57 +0000 |
commit | 96c3009178e3512ca30d0f36f81e22953afb9f88 (patch) | |
tree | aa77f7c5766e7e1ca88b63fc93072c79af90a977 /includes | |
parent | b9b015ff19edf564966c5dd6adedaab5ef514375 (diff) | |
download | brdo-96c3009178e3512ca30d0f36f81e22953afb9f88.tar.gz brdo-96c3009178e3512ca30d0f36f81e22953afb9f88.tar.bz2 |
- Patch #134697 by hunmonk: make table row coloring work in absence of numeric IDs.
Diffstat (limited to 'includes')
-rw-r--r-- | includes/theme.inc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/includes/theme.inc b/includes/theme.inc index 6e2a69c2e..bf12b0518 100644 --- a/includes/theme.inc +++ b/includes/theme.inc @@ -1092,6 +1092,8 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) { // Format the table rows: $output .= "<tbody>\n"; if (count($rows)) { + $flip = array('even' => 'odd', 'odd' => 'even'); + $class = 'even'; foreach ($rows as $number => $row) { $attributes = array(); @@ -1111,7 +1113,7 @@ function theme_table($header, $rows, $attributes = array(), $caption = NULL) { } // Add odd/even class - $class = ($number % 2 == 1) ? 'even': 'odd'; + $class = $flip[$class]; if (isset($attributes['class'])) { $attributes['class'] .= ' '. $class; } |