在Codeigniter中创建PHP矩阵表

时间:2019-02-27 16:41:40

标签: php html codeigniter

我正在尝试创建一个交互式任务板,参与者可以如图所示互相提问:

enter image description here

下面是我的视图的外观。这将生成表格设计,如上图所示。但是我如何扩展表功能,以便每个tr-> td绑定/对应于特定的thead-> tr-> th?

<table class="table" id="projTable">

<thead>
    <tr>
    <th></th>

<?php
foreach ($Participants as $Participant) {
    echo '<th> '.$Participant['username'].' </th>';
}
?>
  </tr>
</thead>

<tbody>

<?php
$counttoken = count($Participants);

foreach ($Participants as $Participant) {
   echo '<tr>';
   echo '<td> '.$Participant['username'].' </td>';

   for($i=0; $i<$counttoken; $i++) {
       echo '<td> </td>';
      
   }
}

   echo '</tr>';
?>



</tbody>
</table>

1 个答案:

答案 0 :(得分:0)

数据库结构:

DB STRUCTURE IMAGE