<h4>Data Barang</h4>
<table class="table data-table">
<thead>
    <tr>
        <th>No</th>
        <th>Kode Barang</th>
        <th>Nama Barang</th>
        <th>Harga Beli</th>
        <th>Harga Jual</th>
        <th>Kategori</th>
        <th>Stok</th>
    </tr>
</thead>
<?php
    $barang=$this->db->query("select * from barang")->result_array();
    $no=1;
    foreach($barang as $row){
?>
<tr>
    <td><?=$no?></td>
    <td><?=$row['kode']?></td>
    <td><?=$row['nama']?></td>
    <td><?=$row['hargabeli']?></td>
    <td><?=$row['hargajual']?></td>
    <td><?=$row['kategori']?></td>
    <td><?=$row['stock']?></td>
</tr>
<?php
    $no++;
    }
?>
</table>