diff --git a/admin/renderer.php b/admin/renderer.php
index 8d496364d35..b39976d2220 100644
--- a/admin/renderer.php
+++ b/admin/renderer.php
@@ -1245,10 +1245,9 @@ class core_admin_renderer extends plugin_renderer_base {
             get_string('report'),
             get_string('status'),
         );
-        $servertable->align = array('center', 'center', 'left', 'center');
-        $servertable->wrap  = array('nowrap', '', '', 'nowrap');
-        $servertable->size  = array('10', 10, '100%', '10');
-        $servertable->attributes['class'] = 'environmenttable generaltable';
+        $servertable->colclasses = array('centeralign name', 'centeralign status', 'leftalign report', 'centeralign info');
+        $servertable->attributes['class'] = 'admintable environmenttable generaltable';
+        $servertable->id = 'serverstatus';
 
         $serverdata = array('ok'=>array(), 'warn'=>array(), 'error'=>array());
 
@@ -1258,10 +1257,9 @@ class core_admin_renderer extends plugin_renderer_base {
             get_string('report'),
             get_string('status'),
         );
-        $othertable->align = array('center', 'left', 'center');
-        $othertable->wrap  = array('', '', 'nowrap');
-        $othertable->size  = array(10, '100%', '10');
-        $othertable->attributes['class'] = 'environmenttable generaltable';
+        $othertable->colclasses = array('aligncenter info', 'alignleft report', 'aligncenter status');
+        $othertable->attributes['class'] = 'admintable environmenttable generaltable';
+        $othertable->id = 'otherserverstatus';
 
         $otherdata = array('ok'=>array(), 'warn'=>array(), 'error'=>array());
 
diff --git a/admin/roles/assign.php b/admin/roles/assign.php
index 45ea5f83365..4b7cef81bf8 100644
--- a/admin/roles/assign.php
+++ b/admin/roles/assign.php
@@ -189,7 +189,7 @@ $assignurl = new moodle_url($PAGE->url, array('roleid'=>$roleid));
 <form id="assignform" method="post" action="<?php echo $assignurl ?>"><div>
   <input type="hidden" name="sesskey" value="<?php echo sesskey() ?>" />
 
-  <table summary="" class="roleassigntable generaltable generalbox boxaligncenter" cellspacing="0">
+  <table id="assigningrole" summary="" class="admintable roleassigntable generaltable" cellspacing="0">
     <tr>
       <td id="existingcell">
           <p><label for="removeselect"><?php print_string('extusers', 'role'); ?></label></p>
@@ -278,15 +278,13 @@ $assignurl = new moodle_url($PAGE->url, array('roleid'=>$roleid));
 
     // Print overview table
     $table = new html_table();
-    $table->tablealign = 'center';
-    $table->width = '60%';
+    $table->id = 'assignrole';
     $table->head = array(get_string('role'), get_string('description'), get_string('userswiththisrole', 'role'));
-    $table->wrap = array('nowrap', '', 'nowrap');
-    $table->align = array('left', 'left', 'center');
+    $table->colclasses = array('leftalign role', 'leftalign', 'centeralign userrole');
+    $table->attributes['class'] = 'admintable generaltable';
     if ($showroleholders) {
         $table->headspan = array(1, 1, 2);
-        $table->wrap[] = 'nowrap';
-        $table->align[] = 'left';
+        $table->colclasses[] = 'leftalign roleholder';
     }
 
     foreach ($assignableroles as $roleid => $rolename) {
diff --git a/admin/roles/manage.php b/admin/roles/manage.php
index 745681ee268..c7a4f6997be 100644
--- a/admin/roles/manage.php
+++ b/admin/roles/manage.php
@@ -186,10 +186,9 @@
 
 /// Initialise table.
     $table = new html_table();
-    $table->tablealign = 'center';
-    $table->align = array('left', 'left', 'left', 'left');
-    $table->wrap = array('nowrap', '', 'nowrap','nowrap');
-    $table->width = '90%';
+    $table->colclasses = array('leftalign', 'leftalign', 'leftalign', 'leftalign');
+    $table->id = 'roles';
+    $table->attributes['class'] = 'admintable generaltable';
     $table->head = array(
         get_string('role') . ' ' . $OUTPUT->help_icon('roles', 'role'),
         get_string('description'),
diff --git a/admin/tool/xmldb/actions/main_view/main_view.class.php b/admin/tool/xmldb/actions/main_view/main_view.class.php
index 9d4e00222e0..5ac58fc4577 100644
--- a/admin/tool/xmldb/actions/main_view/main_view.class.php
+++ b/admin/tool/xmldb/actions/main_view/main_view.class.php
@@ -120,7 +120,7 @@ class main_view extends XMLDBAction {
         $result = $this->launch('get_db_directories');
         // Display list of DB directories if everything is ok
         if ($result && !empty($XMLDB->dbdirs)) {
-            $o .= '<table id="listdirectories" border="0" cellpadding="5" cellspacing="1" class="boxaligncenter flexible">';
+            $o .= '<table id="listdirectories" border="0" cellpadding="5" cellspacing="1" class="admintable generaltable">';
             $row = 0;
             foreach ($XMLDB->dbdirs as $key => $dbdir) {
                 // Detect if this is the lastused dir
diff --git a/admin/user.php b/admin/user.php
index aac71123630..6f6bc928875 100644
--- a/admin/user.php
+++ b/admin/user.php
@@ -256,25 +256,26 @@
 
         $table = new html_table();
         $table->head = array ();
-        $table->align = array();
+        $table->colclasses = array();
         $table->head[] = $fullnamedisplay;
-        $table->align[] = 'left';
+        $table->attributes['class'] = 'admintable generaltable';
+        $table->colclasses[] = 'leftalign';
         foreach ($extracolumns as $field) {
             $table->head[] = ${$field};
-            $table->align[] = 'left';
+            $table->colclasses[] = 'leftalign';
         }
         $table->head[] = $city;
-        $table->align[] = 'left';
+        $table->colclasses[] = 'leftalign';
         $table->head[] = $country;
-        $table->align[] = 'left';
+        $table->colclasses[] = 'leftalign';
         $table->head[] = $lastaccess;
-        $table->align[] = 'left';
+        $table->colclasses[] = 'leftalign';
         $table->head[] = get_string('edit');
-        $table->align[] = 'center';
+        $table->colclasses[] = 'centeralign';
         $table->head[] = "";
-        $table->align[] = 'center';
+        $table->colclasses[] = 'centeralign';
 
-        $table->width = "95%";
+        $table->id = "users";
         foreach ($users as $user) {
             if (isguestuser($user)) {
                 continue; // do not display guest here
diff --git a/cohort/index.php b/cohort/index.php
index 35d794ffb2c..38ecfe6a474 100644
--- a/cohort/index.php
+++ b/cohort/index.php
@@ -134,9 +134,9 @@ foreach($cohorts['cohorts'] as $cohort) {
 $table = new html_table();
 $table->head  = array(get_string('name', 'cohort'), get_string('idnumber', 'cohort'), get_string('description', 'cohort'),
                       get_string('memberscount', 'cohort'), get_string('component', 'cohort'), get_string('edit'));
-$table->size  = array('20%', '10%', '40%', '10%', '10%', '10%');
-$table->align = array('left', 'left', 'left', 'left','center', 'center');
-$table->width = '80%';
+$table->colclasses = array('leftalign name', 'leftalign id', 'leftalign description', 'leftalign size','centeralign source', 'centeralign action');
+$table->id = 'cohorts';
+$table->attributes['class'] = 'admintable generaltable';
 $table->data  = $data;
 echo html_writer::table($table);
 echo $OUTPUT->paging_bar($cohorts['totalcohorts'], $page, 25, $baseurl);
diff --git a/comment/locallib.php b/comment/locallib.php
index e7e36900a56..d56d954aef3 100644
--- a/comment/locallib.php
+++ b/comment/locallib.php
@@ -160,8 +160,9 @@ class comment_manager {
             get_string('content'),
             get_string('action')
         );
-        $table->align = array ('left', 'left', 'left', 'left');
-        $table->attributes = array('class'=>'generaltable commentstable');
+        $table->colclasses = array ('leftalign', 'leftalign', 'leftalign', 'leftalign');
+        $table->attributes = array('class'=>'admintable generaltable');
+        $table->id = 'commentstable';
         $table->data = array();
 
         $link = new moodle_url('/comment/index.php', array('action' => 'delete', 'sesskey' => sesskey()));
diff --git a/course/index.php b/course/index.php
index a1a5e569957..1401132c652 100644
--- a/course/index.php
+++ b/course/index.php
@@ -254,7 +254,7 @@ $parentlist = array();
 $displaylist[0] = get_string('top');
 make_categories_list($displaylist, $parentlist);
 
-echo '<table class="generaltable editcourse boxaligncenter"><tr class="header">';
+echo '<table id="coursecategories" class="admintable generaltable editcourse"><tr class="header">';
 echo '<th class="header" scope="col">'.$strcategories.'</th>';
 echo '<th class="header" scope="col">'.$strcourses.'</th>';
 echo '<th class="header" scope="col">'.$stredit.'</th>';
@@ -309,7 +309,7 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
             $category->context = context_coursecat::instance($category->id);
         }
 
-        echo '<tr><td align="left" class="name">';
+        echo '<tr><td class="leftalign name">';
         for ($i=0; $i<$depth;$i++) {
             echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
         }
@@ -319,9 +319,9 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
              format_string($category->name, true, array('context' => $category->context)).'</a>';
         echo '</td>';
 
-        echo '<td class="count">'.$category->coursecount.'</td>';
+        echo '<td class="centeralign count">'.$category->coursecount.'</td>';
 
-        echo '<td class="icons">';    /// Print little icons
+        echo '<td class="centeralign icons">';  /// Print little icons
 
         if (has_capability('moodle/category:manage', $category->context)) {
             echo '<a title="'.$str->edit.'" href="editcategory.php?id='.$category->id.'"><img'.
@@ -358,7 +358,7 @@ function print_category_edit($category, $displaylist, $parentslist, $depth=-1, $
         }
         echo '</td>';
 
-        echo '<td align="left">';
+        echo '<td class="leftalign">';
         if (has_capability('moodle/category:manage', $category->context)) {
             $tempdisplaylist = $displaylist;
             unset($tempdisplaylist[$category->id]);
diff --git a/report/configlog/index.php b/report/configlog/index.php
index 83727270ec4..80bf0b88c67 100644
--- a/report/configlog/index.php
+++ b/report/configlog/index.php
@@ -92,9 +92,9 @@ if (($CFG->fullnamedisplay == 'firstname lastname') or
 
 $table = new html_table();
 $table->head  = array($hcolumns['timemodified'], $fullnamedisplay, $hcolumns['plugin'], $hcolumns['name'], $hcolumns['value'], $hcolumns['oldvalue']);
-$table->align = array('left',                    'left',           'left',              'left',            'left',             'left');
-$table->size  = array('30%',                     '10%',            '10%',               '10%',             '20%',              '20%');
-$table->width = '95%';
+$table->colclasses = array('leftalign date', 'leftalign name', 'leftalign plugin', 'leftalign setting', 'leftalign newvalue', 'leftalign originalvalue');
+$table->id = 'configchanges';
+$table->attributes['class'] = 'admintable generaltable';
 $table->data  = array();
 
 if ($sort == 'firstname' or $sort == 'lastname') {
diff --git a/report/security/index.php b/report/security/index.php
index 339ddaaf59d..7d356f07b80 100644
--- a/report/security/index.php
+++ b/report/security/index.php
@@ -76,9 +76,9 @@ if ($issue and ($result = $issue(true))) {
 
     $table = new html_table();
     $table->head  = array($strissue, $strstatus, $strdesc, $strconfig);
-    $table->size  = array('30%', '10%', '50%', '10%' );
-    $table->align = array('left', 'left', 'left', 'left');
-    $table->attributes = array('class'=>'scurityreporttable generaltable');
+    $table->rowclasses = array('leftalign issue', 'leftalign status', 'leftalign desc', 'leftalign config');
+    $table->attributes = array('class'=>'admintable securityreport generaltable');
+    $table->id = 'securityissuereporttable';
     $table->data  = array();
 
     // print detail of one issue only
@@ -103,9 +103,9 @@ if ($issue and ($result = $issue(true))) {
 
     $table = new html_table();
     $table->head  = array($strissue, $strstatus, $strdesc);
-    $table->size  = array('30%', '10%', '60%' );
-    $table->align = array('left', 'left', 'left');
-    $table->attributes = array('class'=>'scurityreporttable generaltable');
+    $table->colclasses = array('leftalign issue', 'leftalign status', 'leftalign desc');
+    $table->attributes = array('class'=>'admintable securityreport generaltable');
+    $table->id = 'securityreporttable';
     $table->data  = array();
 
     foreach ($issues as $issue) {