CI table->generate($data1, $data2, $data3)will output my data in the form of a simple table , for example:
<table>
<tr>
<td>data1</td>
<td>data2</td>
<td>data3</td>
</tr>
</table>
What if I need a complex layout of cells with several $varsin each cell:
$data1 = array('one', 'two', 'three');
and I want something like this:
<table>
<tr>
<td>
<div class="caption">$data1[0]</div>
<span class="span1">$data1[1] and here goes <strong>$data1[2]</strong></span>
</td>
<td>...</td>
<td>...</td>
</tr>
</table>
How do I encode this part?
Now I just create the content tdin the model and then call generate(). But this means that my HTML for the cell is in the model, but I would like to leave it in the form.
source
share