I have a situation, I wish to have 3 word in 1 table data.
For example,
one, two, three
I want four to appear below.
For example.
- One, two, three,
- four, five, six,
- seven, eight, nine,
- and so on..
How do I achieve this using table. Am trying to incorporate this in cakephp. I am using for loop to list the numbers down.
<table>
<tbody>
<tr>
<?php foreach ($professionalPassion as $us): ?>
<td>
<legend><?php echo $us['PassionsUser']['passion_tag'] ?></legend>
Type: <?php echo $us['PassionsUser']['type'] ?><br/>
Description: <?php echo $us['PassionsUser']['description'] ?><br/>
<?php echo $this->Html->link(__('Edit', true), array('controller' => 'PassionsUsers', 'action' => 'edit_passion', $us['PassionsUser']['id'])); ?> |
<?php echo $this->Html->link(__('Delete', true), array('controller' => 'PassionsUsers', 'action' => 'delete', $us['PassionsUser']['id'])); ?>
<?php endforeach; ?>
</td>
</tr>
</tbody>
</table>
This is a helper function I wrote to do exactly that:
$cellswill contain your array of data,$colsthe number of columns for the table, and$classany class to add to the table.UPDATE
Integrated with your code: