<!DOCTYPE html>
<html>
<head>
    <title>Membuat Tabel</title>
    <style>
        table { border-collapse: collapse; }
        td { border: 1px solid #333; padding: 5px 10px; }
    </style>
</head>
<body>
    <h3>Membuat Tabel</h3>
    <form action="TabelKolom_forloop.php" method="POST">
        Jumlah Baris  : <input type="text" name="baris" value="5" /><br /><br />
        Jumlah Kolom : <input type="text" name="kolom" value="3" /><br /><br />
        <input type="submit" name="create" value="Create" />
    </form>

    <?php
    if (isset($_POST["create"])) {
        $baris = $_POST["baris"];
        $kolom = $_POST["kolom"];

        echo "<h4>Tabel hasil :</h4>";
        echo "<table>";

        for ($i = 1; $i <= $baris; $i++) {
            echo "<tr>";
            for ($j = 1; $j <= $kolom; $j++) {
                echo "<td>baris " . $i . " , kolom " . $j . "</td>";
            }
            echo "</tr>";
        }

        echo "</table>";
    }
    ?>
</body>
</html>