<div>&nbsp;</div>
<table class="table table-hover table-bordered" id="tabelstokis">
<thead>
<tr>
    <th scope="col">Kode Barang</th>
    <th scope="col">Nama Barang</th>
    <th scope="col">Rak</th>
    <th scope="col" width="15%">Stok Fisik</th>
    <!--<th scope="col">Keterangan</th>-->
    <!--<th scope="col" width="2%"></th>-->
</tr>
</thead>
<tbody>
<?php
$no=1;
foreach ($databarang as $hasil) {
    ?>
    <tr>
        <td><?php echo $hasil->kode_barang ?></td>
        <td><?php echo $hasil->barang ?></td>
        <td><?php echo $hasil->nama_rak ?></td>
        <td>
            <input type="hidden" name="id<?php echo $no ?>" id="id<?php echo $no ?>" value="<?php echo $hasil->id_stokopnamemeta ?>">
            <input type="number" class="form-control" name="nyata<?php echo $no ?>" id="nyata<?php echo $no ?>" value="<?php echo $hasil->stok_nyata ?>" onkeypress="simpan(<?php echo $no ?>)" onkeyup="simpan(<?php echo $no ?>)" onchange="simpan(<?php echo $no ?>)" oninput="simpan(<?php echo $no ?>)">
        </td>
        <!--<td>
            <textarea class="form-control" name="keterangan<?php echo $no ?>" id="keterangan<?php echo $no ?>" onkeypress="simpan(<?php echo $no ?>)" onkeyup="simpan(<?php echo $no ?>)" onchange="simpan(<?php echo $no ?>)" oninput="simpan(<?php echo $no ?>)"><?php echo $hasil->keterangan ?></textarea>
        </td>-->
        <!--<td>
            <button type="button" title="Hapus" onclick="konfirhapus(this.value)" class="btn btn-danger btn-sm" value="<?php echo $hasil->id_stokopnamemeta ?>"><i class="fa fa-trash"></i></button>
        </td>-->
    </tr>
    <?php
    $no++;
}
?>
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function() {
    $("#tabelstokis").DataTable({
        "processing":true,
        "responsive":true,
        "paging": false,
        "ordering": false
    });
});
</script>