theme_table drupal development

拜拜、爱过 提交于 2019-12-02 13:25:37

Without having an example of the data you are starting with it is difficult to give you exact code to solve your problem.

In general the best way to built tables in Drupal is like this:


$table_headers = array(
  t('UGentID'), // this is the header for the first column
  t('Internships'), // this is the header for the second column
);
$table_rows = array()
foreach ($studentUGentID as $key => $value) {
  $table_rows[] = array(
    'column 1 data', // add all the data for the row one column
    'column 2 data', // at a time
  );
}
$html = theme('table', $table_headers, $table_rows);

As I said without knowing what is in $studentUGentID and $internships I cannot help further.

With sample data I could help you more.

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