Index: moodle/course/lib.php
--- moodle/course/lib.php Base (1.752)
+++ moodle/course/lib.php Locally Modified (Based On 1.752)
@@ -2024,75 +2024,74 @@
         $catimage = "&nbsp;";
     }
 
-    echo "\n\n".'<table class="categorylist">';
-
     $courses = get_courses($category->id, 'c.sortorder ASC', 'c.id,c.sortorder,c.visible,c.fullname,c.shortname,c.summary');
     if ($showcourses and $coursecount) {
+        echo '<div class="categorylist clearfix">';
+        echo '<div class="category">';
+        $cat = '';        
+        $cat .= html_writer::tag('div', $catimage, array('class'=>'image'));
+        $catlink = '<a '.$catlinkcss.' href="'.$CFG->wwwroot.'/course/category.php?id='.$category->id.'">'. format_string($category->name).'</a>';
+        $cat .= html_writer::tag('div', $catlink, array('class'=>'name'));        
 
-        echo '<tr>';
-
-        if ($depth) {
-            $indent = $depth*30;
-            $rows = count($courses) + 1;
-            echo '<td class="category indentation" rowspan="'.$rows.'" valign="top">';
-
-            echo $OUTPUT->spacer(array('height'=>10, 'width'=>$indent, 'br'=>true)); // should be done with CSS instead
-            echo '</td>';
+        $indent = '';
+        if ($depth > 0) {
+            for ($i=0; $i< $depth; $i++) {
+                $indent = html_writer::tag('div', $indent .$cat, array('class'=>'indentation'));
+                $cat = '';
         }
+        } else {
+            $indent = $cat;
+        }
+        echo $indent;
 
-        echo '<td valign="top" class="category image">'.$catimage.'</td>';
-        echo '<td valign="top" class="category name">';
-        echo '<a '.$catlinkcss.' href="'.$CFG->wwwroot.'/course/category.php?id='.$category->id.'">'. format_string($category->name).'</a>';
-        echo '</td>';
-        echo '<td class="category info">&nbsp;</td>';
-        echo '</tr>';
+        echo '</div>'; //category
 
+        echo html_writer::tag('div', '', array('class'=>'clearfloat'));
+
         // does the depth exceed maxcategorydepth
         // maxcategorydepth == 0 or unset meant no limit
-
         $limit = !(isset($CFG->maxcategorydepth) && ($depth >= $CFG->maxcategorydepth-1));
-
         if ($courses && ($limit || $CFG->maxcategorydepth == 0)) {
             foreach ($courses as $course) {
                 $linkcss = $course->visible ? '' : ' class="dimmed" ';
-                echo '<tr><td valign="top">&nbsp;';
-                echo '</td><td valign="top" class="course name">';
-                echo '<a '.$linkcss.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'. format_string($course->fullname).'</a>';
-                echo '</td><td align="right" valign="top" class="course info">';
+                
+                $coursecontent = '';
+                $courselink = '<a '.$linkcss.' href="'.$CFG->wwwroot.'/course/view.php?id='.$course->id.'">'. format_string($course->fullname).'</a>';
+                $coursecontent .= html_writer::tag('div', $courselink, array('class'=>'name'));
+                
                 //TODO: add some guest, pay icons
                 if ($course->summary) {
                     $link = new moodle_url('/course/info.php?id='.$course->id);
-                    echo $OUTPUT->action_link($link, '<img alt="'.$strsummary.'" src="'.$OUTPUT->pix_url('i/info') . '" />',
+                    $actionlink = $OUTPUT->action_link($link, '<img alt="'.$strsummary.'" src="'.$OUTPUT->pix_url('i/info') . '" />',
                         new popup_action('click', $link, 'courseinfo', array('height' => 400, 'width' => 500)),
                         array('title'=>$strsummary));
-                } else {
-                    echo '<img alt="" style="width:18px;height:16px;" src="'.$OUTPUT->pix_url('spacer') . '" />';
+
+                    $coursecontent .= html_writer::tag('div', $actionlink, array('class'=>'info'));
                 }
-                echo '</td></tr>';
+                
+                $indent = '';
+                for ($i=1; $i <= $depth; $i++) {
+                    $indent = html_writer::tag('div', $indent . $coursecontent , array('class'=>'indentation'));
+                    $coursecontent = '';
             }
+                
+                echo html_writer::tag('div', $indent, array('class'=>'course clearfloat'));
         }
+        }       
+        echo '</div>'; //categorylist        
     } else {
-
-        echo '<tr>';
-
+        echo '<div class="categorylist">';
+        echo '<div class="category">';
         if ($depth) {
             $indent = $depth*20;
-            echo '<td class="category indentation" valign="top">';
             echo $OUTPUT->spacer(array('height'=>10, 'width'=>$indent, 'br'=>true)); // should be done with CSS instead
-            echo '</td>';
         }
-
-        echo '<td valign="top" class="category name">';
         echo '<a '.$catlinkcss.' href="'.$CFG->wwwroot.'/course/category.php?id='.$category->id.'">'. format_string($category->name).'</a>';
-        echo '</td>';
-        echo '<td valign="top" class="category number">';
-        if (count($courses)) {
-           echo count($courses);
+        echo '<span class="numberofcourse" title="' .get_string('numberofcourses') . '"> ('.count($courses).')</span>';
+        echo '</div>';
+        echo '</div>';
         }
-        echo '</td></tr>';
     }
-    echo '</table>';
-}
 
 /**
  * Print the buttons relating to course requests.
Index: moodle/lang/en/moodle.php
--- moodle/lang/en/moodle.php Base (1.548)
+++ moodle/lang/en/moodle.php Locally Modified (Based On 1.548)
@@ -1811,3 +1811,4 @@
 $string['yourteacher'] = 'your {$a}';
 $string['yourwordforx'] = 'Your word for \'{$a}\'';
 $string['zippingbackup'] = 'Zipping backup';
+$string['numberofcourses'] = 'Number of courses';
Index: moodle/theme/base/style/core.css
--- moodle/theme/base/style/core.css Base (1.48)
+++ moodle/theme/base/style/core.css Locally Modified (Based On 1.48)
@@ -93,6 +93,9 @@
 form.popupform,
 form.popupform div {display: inline;}
 .arrow_button input {overflow:hidden;}
+.categorylist .category .numberofcourse {font-style: italic; font-size: 0.85em; font-style: normal;}
+.categorylist .category {padding-top: 5px; padding-bottom: 5px; }
+
 /** IE6 float + background bug solution **/
 .ie6 li.section {line-height:1.2em;width:100%;}
 

Index: moodle/theme/base/style/course.css
--- moodle/theme/base/style/course.css Base (1.7)
+++ moodle/theme/base/style/course.css Locally Modified (Based On 1.7)
@@ -104,6 +114,8 @@
 .jsenabled .course_category_tree .category.with_children.collapsed .subcategories,
 .jsenabled .course_category_tree .category.with_children.collapsed .courses {display:none;}
 
+#page-course-index .indentation {padding-left: 30px;}
+#page-course-index.dir-rtl .indentation {padding-left: 0px;padding-right: 30px;}
 /** Overide for RTL layout **/
 .dir-rtl .coursebox .info {float: right; text-align: right;}
 .dir-rtl .coursebox .summary {text-align:right;}
