New html_writer shortcut functions

Re: New html_writer shortcut functions

by Raymond Mlambo -
Number of replies: 0

Hi Davo,


You're awesome. I just used what you mentioned and it its working well. How can I put vertical borders in my table though?

The table in the screenshot attached is outputting the rows beautifully, but I need vertical borders to separate the items and make things look neat. How can I accomplish? I have specified borders in my css class, and I'm not getting the results that I want.

Here is a sample of the code for this table:

// Display the course rubric so that the students know what they'll be graded on
$courserubric = $DB->get_record('rubric', array('courseid' => $course->id));

$table = new html_table();
$table->head = array($courserubric->h11, $courserubric->h12, $courserubric->h13, $courserubric->h14, $courserubric->h15);

$row = new html_table_row(array($courserubric->n11, $courserubric->n12, $courserubric->n13, $courserubric->n14, $courserubric->n15));
$row->attributes['class'] = 'courserubric-tablerow';
$table->data[] = $row;

$row = new html_table_row(array($courserubric->n21, $courserubric->n22, $courserubric->n23, $courserubric->n24, $courserubric->n25));
$row->attributes['class'] = 'courserubric-tablerow';
$table->data[] = $row;

echo html_writer::table($table);