다음 2 개의 배열을 가지고 있는데, 테이블에 표시하고 싶습니다. 문제는 그가 내 화면에 1 번 20 번 인쇄한다는 것입니다. for 루프를 추가했지만 문제가 해결되지 않았습니까? 그 이유는 무엇일까요?여러 행을 가진 theme_table
enter code here$header = array();
$header[] = array('data' => 'UGentID');
$header[] = array('data' => 'Internships');
// this big array will contains all rows
$rows = array();
//for($i = 0; $i<=($studentUGentID); $i++) {
foreach($studentUGentID as $key=>$value) {
foreach($internshipNaam as $key2=>$value2) {
// each loop will add a row here.
$row = array();
// build the row
$row[] = array('data' => $value[0]['value']);
$row[] = array('data' => $value2);
// add the row to the "big row data (contains all rows)
$rows[] = array('data' => $row);
}
}
//}
$output = theme('table', $header, $rows);
return $output;
같은 질문을 3 번이나했습니다. 와우. http://stackoverflow.com/questions/5501402/why-does-each-field-appear-in-a-newrowrow/ http://stackoverflow.com/questions/5498350/theme-table-drupal-development – Haza
어쩌면 내 동료 StackOverflow 설명을 이해하지, 잘하면 내가 답변을 얻고있다. 나는 다시 묻지 않을 것이다. 내 사과. – user001