<table class="table table-sm">
    <?php
    foreach ($unit as $u) {
        echo "<tr>";
        echo "<td>" . $u['unit'] . "</td>";
        echo "<td><input type='checkbox' name='pilihan[]' id='pilihan[]' value='" . $u['unit'] . "'></td>";
        echo "</tr>";
    }
    ?>
</table>