<table class="table table-sm table-bordered" border="1" rules="All">
    <thead>
        <tr class="table-warning">
            <th>#</th>
            <th>Tgl</th>
            <th>No SJ</th>
            <th>Keterangan</th>
            <th>Kota</th>
            <th>DK/LK</th>
        </tr>
    </thead>
    <tbody>
        <?php
        $i = 1;
        foreach ($data as $d) {
            $detail = $this->M_gudang->get_detail_sj($d['doc_sj']);
            echo "<tr>";
            echo "<td><b>" . $i . "</b></td>";
            echo "<td><b>" . $d['tgl'] . "</b></td>";
            echo "<td><b>" . $d['no_sj'] . "</b></td>";
            echo "<td><b>" . $d['keterangan'] . "</b></td>";
            echo "<td><b>" . $d['kota'] . "</b></td>";
            echo "<td><b>" . $d['dk_lk'] . "</b></td>";
            echo "</tr>";
            echo "<tr>";
            $nmr = 1;
            foreach ($detail as $dtl) {
                echo "<tr>";
                echo "<td><i class='bi bi-chevron-right'></i>&nbsp;" . $nmr . "</td>";
                echo "<td colspan='2'>" . $dtl['sku'] . "</td>";
                echo "<td colspan='2'>" . $dtl['barang'] . "</td>";
                echo "<td style='text-align: right;'>" . $dtl['qty'] . "</td>";
                echo "</tr>";
                $nmr++;
            }
            echo "</tr>";
            $i++;
        }
        ?>
    </tbody>
</table>