Welcome Guest, Not a member yet? Register   Sign In
How to add a custom row into a table?
#1

[eluser]Alhazred[/eluser]
I have a table created in this way
Code:
foreach ($data as $value)
{
$tot += $value['price'];
$button = '<input type="button" name="del" id="del" value="'.lang('crd_del_item').'" alt="'.$value['id'].'-'.$value['id_type'].'" />';
$this->table->add_row($value['type'],$value['name'],$value['qty'],$value['price'], $button);
}

echo $this->table->generate();
This works, but I want to add a row like this at the end:
Code:
<tr>
<td colspan='3' class='total'>&lt;?php echo lang('crd_total_price') ?&gt;</td>
<td colspan='2' class='price'>&lt;?php echo $tot ?&gt;</td>
</tr>
How do I add it?
#2

[eluser]CroNiX[/eluser]
Looks like you can set the template and add your <tr> code to the 'table_close' part just before the '</table>'.
#3

[eluser]Alhazred[/eluser]
Thanks, solved Smile




Theme © iAndrew 2016 - Forum software by © MyBB