<table style="width: 600px" class="slicedTable">
<tr>
<th>Spetsialist</th>
<th>Tunnid</th>
</tr>
<tr>
<?php foreach($specs as $specName => $spec): ?>
<td><?php echo $specName?>
<tr>
<?php endforeach; ?>
<td>
<?php foreach($tunnid as $tund): ?>
<td><?php echo $tund?></td>
</td>
<?php endforeach; ?>
</tr>
</table>
我需要这个来打印出一个常规表,它的位置如下:
name 1 - value1
name2 - value2
眼镜:
$specs = array();
foreach($data as $row) {
$workerName = $row['Worker']['name'];
if (!isset($specs[$workerName])) {
$specs[$workerName] = array('procs' => array(), 'extras' => array());
}
但是我似乎无法做到这一点,请帮助。