Why does each field appear in a new row?

2019-08-29 23:44发布

I have made this table: I have 2 array's UGentArray and InternshipsArray.

How can I set these in my table? Instead of "Row column 1 data" and "Row column 2 data".

My question is: I want the values from UGentArray and InternshipArray as 2 columns under each title UGentID and Internships.

How would one modify the following code so that each field appeared in a new table row (instead of fields in adjacent cells within the same row)?

// Make table and display on screen.
$tbl_header = array();
$tbl_header[] = array("data" => "UGentID");
$tbl_header[] = array("data" => "Internships");
$tbl_row = array();
$tbl_rows[] = array();

foreach($studentUGentID as $key => $value) {
    $tbl_row[] = $value[0]['value'];
}

//$tbl_row[] = "Row column 1 data";
$tbl_row[] = "Row column 2 data";
$tbl_rows = array();
$tbl_rows[] = $tbl_row;

$html = theme('table', $tbl_header, $tbl_rows);

return $html;

enter image description here

0条回答
登录 后发表回答