by Davo Smith.
What about this (in the real solution you should, obviously, use get_string for the titles):
$table = new html_table();
$table->head = array('Lastname', 'Firstname', 'ID Number');
$table->data[] = array(... first row of data goes here ...);
$table->data[] = array( ... second row of data goes here ...);
echo html_writer::table($table);
(I'm assuming you are using html_table anyway, as that is the standard Moodle way of creating tables and you haven't specified otherwise).