Index: wp-admin/categories.php
===================================================================
--- wp-admin/categories.php	(revision 12704)
+++ wp-admin/categories.php	(working copy)
@@ -238,9 +238,9 @@
 	</tr>
 	</tfoot>
 
-	<tbody id="the-list" class="list:cat">
+	<tbody id="the-list" class="list:cat categories">
 <?php
-cat_rows(0, 0, 0, $pagenum, $cats_per_page, $taxonomy);
+cat_rows($pagenum, $cats_per_page);
 ?>
 	</tbody>
 </table>
Index: wp-admin/css/colors-classic.dev.css
===================================================================
--- wp-admin/css/colors-classic.dev.css	(revision 12704)
+++ wp-admin/css/colors-classic.dev.css	(working copy)
@@ -600,6 +600,9 @@
 	background-color: #fff;
 }
 
+.categories .notfound,
+.categories .notfound th,
+.categories .notfound td,
 .plugins .inactive,
 .plugins .inactive th,
 .plugins .inactive td,
Index: wp-admin/css/colors-fresh.dev.css
===================================================================
--- wp-admin/css/colors-fresh.dev.css	(revision 12704)
+++ wp-admin/css/colors-fresh.dev.css	(working copy)
@@ -595,6 +595,9 @@
 	background-color: #fff;
 }
 
+.categories .notfound,
+.categories .notfound th,
+.categories .notfound td,
 .plugins .inactive,
 .plugins .inactive th,
 .plugins .inactive td,
Index: wp-admin/includes/template.php
===================================================================
--- wp-admin/includes/template.php	(revision 12704)
+++ wp-admin/includes/template.php	(working copy)
@@ -8,37 +8,43 @@
  * @subpackage Administration
  */
 
-// Ugly recursive category stuff.
+// Nice recursive category stuff.
 /**
  * {@internal Missing Short Description}}
  *
  * @since unknown
  *
- * @param unknown_type $parent
- * @param unknown_type $level
- * @param unknown_type $categories
- * @param unknown_type $page
- * @param unknown_type $per_page
+ * @param numeric $page
+ * @param numeric $per_page
+ * @return string
  */
-function cat_rows( $parent = 0, $level = 0, $categories = 0, $page = 1, $per_page = 20, $taxonomy = 'category' ) {
+function cat_rows( $page = 1, $per_page = 20, $taxonomy = 'category' ) {
 
-	$count = 0;
+	$_cats = $cats = $categories = array();
+	$args = (!empty($_GET['s'])) ? array('search' => $_GET['s'], 'hide_empty' => 0) : array('hide_empty' => 0);
 
-	if ( empty($categories) ) {
+	$_cats = get_categories( $args );
+	foreach ($_cats as $_cat) { $_cat->_found = true; $cats[$_cat->term_id] = $_cat;}
+	unset($_cats, $_cat);
 
-		$args = array('hide_empty' => 0, 'taxonomy' => $taxonomy);
-		if ( !empty($_GET['s']) )
-			$args['search'] = $_GET['s'];
+	$categories	= array_slice($cats, ($page - 1) * $per_page, $per_page, true);
 
-		$categories = get_categories( $args );
+	foreach ($categories as $term_id => $category)
+	{
+            $my_parent = $category->parent;
 
-		if ( empty($categories) )
-			return false;
+		if (!$my_parent) continue;
+
+		do { 
+			$my_parent = (isset($cats[$my_parent])) ? $cats[$my_parent] : get_category( $my_parent ); 
+			if (!isset($categories[$my_parent->term_id])) $categories[$my_parent->term_id] = $my_parent; 
+			$my_parent    = $my_parent->parent; 
+		} while ( $my_parent ); 
 	}
 
 	$children = _get_term_hierarchy($taxonomy);
 
-	echo _cat_rows( $parent, $level, $categories, $children, $page, $per_page, $count );
+	echo _cat_rows( $categories, $children );
 
 }
 
@@ -47,56 +53,24 @@
  *
  * @since unknown
  *
- * @param unknown_type $categories
- * @param unknown_type $count
- * @param unknown_type $parent
- * @param unknown_type $level
- * @param unknown_type $page
- * @param unknown_type $per_page
- * @return string the output of the table.
+ * @param array	$categories
+ * @param array	$children
+ * @param numeric	$level
+ * @param numeric	$parent 
+ * @return string
  */
-function _cat_rows( $parent = 0, $level = 0, $categories, &$children, $page = 1, $per_page = 20, &$count ) {
+function _cat_rows( &$categories, &$children, $level = 0, $parent = 0 ) {
 
-	$start = ($page - 1) * $per_page;
-	$end = $start + $per_page;
-
 	$output = '';
-	foreach ( $categories as $key => $category ) {
-		if ( $count >= $end )
-			break;
-
-		if ( $category->parent != $parent && empty($_GET['s']) )
-			continue;
-
-		// If the page starts in a subtree, print the parents.
-		if ( $count == $start && $category->parent > 0 ) {
-
-			$my_parents = array();
-			$p = $category->parent;
-			while ( $p ) {
-				$my_parent = get_category( $p );
-				$my_parents[] = $my_parent;
-				if ( $my_parent->parent == 0 )
-					break;
-				$p = $my_parent->parent;
-			}
-
-			$num_parents = count($my_parents);
-			while( $my_parent = array_pop($my_parents) ) {
-				$output =  "\t" . _cat_row( $my_parent, $level - $num_parents );
-				$num_parents--;
-			}
-		}
-
-		if ( $count >= $start )
-			$output .= "\t" . _cat_row( $category, $level );
-
-		unset( $categories[ $key ] );
-
-		$count++;
-
-		if ( isset($children[$category->term_id]) )
-			$output .= _cat_rows( $category->term_id, $level + 1, $categories, $children, $page, $per_page, $count );
+	foreach ( $categories as $key => $category ) 
+	{
+		if ( $parent == $category->parent ) 
+		{
+			$output .= _cat_row( $category, $level );
+			unset( $categories[ $key ] );
+			if ( isset($children[$category->term_id]) )
+			$output .= _cat_rows( $categories, $children, $level + 1, $category->term_id );
+   		}
 	}
 
 	return $output;
@@ -142,7 +116,7 @@
 		$edit = $name;
 	}
 
-	$row_class = 'alternate' == $row_class ? '' : 'alternate';
+	$row_class = (isset($category->_found)) ? 'found' : 'notfound';
 	$qe_data = get_category_to_edit($category->term_id);
 
 	$category->count = number_format_i18n( $category->count );
@@ -193,7 +167,7 @@
 				$output .= "</td>";
 		}
 	}
-	$output .= '</tr>';
+	$output .= "</tr>\n";
 
 	return $output;
 }
