i'm new on using codeigniter, i want to ask how to make dynamic table so when i select data from anytable form database it can be fit with the table, even the field is different.
so, in normally i show table like this :
<table class="table table-striped">
<thead>
<tr>
<th scope="col">#Number</th>
<th scope="col">Field</th>
</tr>
</thead>
<tbody>
<?php
$no = 1;
foreach ($data as $row) {?>
<tr>
<th scope="row"><?php echo $no++?></th>
<td><?php echo $row->COLUMN_NAME ?></td>
</tr>
<?php } ?>
</tbody>
</table>
but the problem when i using 3 field or more field it can't be fit, so any suggestion for it?