问题
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;
来源:https://stackoverflow.com/questions/5501402/why-does-each-field-appear-in-a-new-row