From: martin Date: Sun, 22 Sep 2002 14:11:45 +0000 (+0000) Subject: Fixes to table widths X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=274f62e6d5bcbfc66175457b765144bc2224d064;p=moodle.git Fixes to table widths --- diff --git a/admin/user.php b/admin/user.php index 73b61f59d1..3e999ebb1c 100644 --- a/admin/user.php +++ b/admin/user.php @@ -149,6 +149,7 @@ $table->head = array ($name, $email, $city, $country, $lastaccess, "", ""); $table->align = array ("LEFT", "LEFT", "LEFT", "LEFT", "LEFT", "CENTER", "CENTER"); + $table->width = "95%"; foreach ($users as $user) { if ($user->id == $USER->id or $user->username == "changeme") { $deletebutton = ""; diff --git a/lib/moodlelib.php b/lib/moodlelib.php index 98bcd45352..10658146db 100644 --- a/lib/moodlelib.php +++ b/lib/moodlelib.php @@ -181,7 +181,7 @@ function print_user_picture($userid, $courseid, $picture, $large=false, $returns } } -function print_table($table, $cellpadding=10, $cellspacing=1) { +function print_table($table) { // Prints a nicely formatted table. // $table is an object with several properties. // $table->head is an array of heading names. @@ -189,6 +189,8 @@ function print_table($table, $cellpadding=10, $cellspacing=1) { // $table->size is an array of column sizes // $table->data[] is an array of arrays containing the data. // $table->width is an percentage of the page +// $table->cellpadding padding on each cell +// $table->cellspacing spacing between cells if (isset($table->align)) { foreach ($table->align as $key => $aa) { diff --git a/user/index.php b/user/index.php index 7a6aa7d4ba..3a4a1d8adf 100644 --- a/user/index.php +++ b/user/index.php @@ -81,6 +81,9 @@ $table->head = array (" ", $name, $city, $country, $lastaccess); $table->align = array ("LEFT", "LEFT", "LEFT", "LEFT", "LEFT"); $table->size = array ("10", "*", "*", "*", "*"); + $table->size = array ("10", "*", "*", "*", "*"); + $table->cellpadding = 2; + $table->cellspacing = 0; foreach ($students as $student) { if ($student->lastaccess) { @@ -101,7 +104,7 @@ "".$COUNTRIES["$student->country"]."", "$lastaccess"); } - print_table($table, 2, 0); + print_table($table); } }