From 96c3009178e3512ca30d0f36f81e22953afb9f88 Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 9 Apr 2007 13:43:57 +0000 Subject: - Patch #134697 by hunmonk: make table row coloring work in absence of numeric IDs. --- includes/theme.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'includes') 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 .= "\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; } -- cgit v1.2.3