計画に対してテーブル製品の構造を設定したい、そのように示したい
+------------------+---------------+---------------+
| product1 | product2 | product3 |
+------------------+---------------+---------------+
| product1plan1 | product2plan1 | product3plan1 |
+------------------+---------------+---------------+
| prouduct1plan2 | product2plan2 | |
+------------------+---------------+---------------+
| product1plan3 | | |
+------------------+---------------+---------------+
でも今はそのように見せてくれます
product1 | product1plan1 | product1plan2 product2 | product2plan1 | product2plan1
ここに私のコードがあります
<table>
<thead>
<tr>
<?php
foreach( $name as $product ) {
$c = 0;
foreach ($product as $key ) {
$c++;
?>
<th>
<?php echo $key['Product']['name']; ?>
<?php for($i = 0; $i < sizeof( $key['ProductPlan'] ); $i++ ) { ?>
<th class= 'packages' id = "<?php echo $key['Product']['name'], $key['ProductPlan'][$i]['product_plan_id']?>"
onclick = "document.getElementById('<?php echo $key['Product']['name']?>').value='<?php echo $key['ProductPlan'][$i]['product_plan_id']?>';"
>
<div product_name='<?php echo $key['Product']['slug']?>' class='amounts amount-<?php echo $key['Product']['slug']?>'>
<div class='tick'>
<?php echo $this->Html->image('tick.png', array('width'=>'25', 'height'=>'25'));?>
</div>
<div class='amount'>
<?php echo $key['ProductPlan'][$i]['name'];?> $
</div>
</div>
</th>
<?php } ?>
</th>
<?php } ?>
<?php } ?>
</tr>
</thead>