html - php/datatables generate table using foreach but need an additional <td></td> at end -
i using datatables , generating table using foreach, need 1 last contain options (edit, etc). cannot think how efficiently this, can think using counter , when output has ended place if statement (rows = rows then) put these last td's in... hoping has better way using current syntax?
<?php foreach($results $row):?> <tr> <?php foreach($row $cell): ?> <td> <?php echo $cell ?> </td> <?php endforeach; ?> </tr> <?php endforeach; ?>
you can put after internal this:
<?php foreach($results $row):?> <tr> <?php foreach($row $cell): ?> <td> <?php echo $cell ?> </td> <?php endforeach; ?> <td>edit </td> <td>show</td><td>delete</td> </tr> <?php endforeach; ?>
Comments
Post a Comment