Why does each field appear in a new row?

筅森魡賤 提交于 2019-12-25 01:26:09

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!