diff --git a/libraries/DisplayResults.php b/libraries/DisplayResults.php index 202ffcfc4c..ce16b0aa77 100644 --- a/libraries/DisplayResults.php +++ b/libraries/DisplayResults.php @@ -2746,8 +2746,6 @@ class DisplayResults // table being displayed has one or more keys; but to display // delete/edit options correctly for tables without keys. - $odd_row = true; - $whereClauseMap = $this->__get('whereClauseMap'); while ($row = $GLOBALS['dbi']->fetchRow($dt_result)) { @@ -2767,11 +2765,10 @@ class DisplayResults if ($GLOBALS['cfg']['BrowseMarkerEnable'] != true) { $tr_class[] = 'nomarker'; } - $tr_class[] = ($odd_row ? 'odd' : 'even'); - $odd_row = ! $odd_row; // pointer code part - $table_body_html .= ''; + $classes = (empty($tr_class) ? ' ' : 'class="' . implode(' ', $tr_class) . '"'); + $table_body_html .= ''; // 1. Prepares the row diff --git a/test/classes/DisplayResultsTest.php b/test/classes/DisplayResultsTest.php index b2cee34a85..68858ca033 100644 --- a/test/classes/DisplayResultsTest.php +++ b/test/classes/DisplayResultsTest.php @@ -372,7 +372,7 @@ class DisplayResultsTest extends PMATestCase array('`new`.`id`' => '= 1'), '[%_PMA_CHECKBOX_DIR_%]', 'odd', - ' Edit', '`customer`.`id` = 1', '%60customer%60.%60id%60+%3D+1', - '' + '' . '' . "\n" . '' . "\n" . ' Delete', 'DELETE FROM `Data`.`customer` WHERE `customer`.`id` = 1', 'odd', - '' . "\n" + '' . "\n" . '