STUDY KASUS 2 - MOD 6

ini merupakan syntax yang harus dsimpan dg .php


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<html>

<head>
<title>Hasil Study Kasus</title>
</head>

<body>

<div align="center">
<?php
$rows = 2;
$columns = 2;
$cells = 2;
?>

  <?php $rows = (int) $_POST["JumlahRow"]; ?>
  <?php $columns = (int) $_POST["JumlahColum"]; ?>
  <?php $cells = (int) $_POST["JumlahCell"]; ?>

  <strong>Anda Memilih</strong> <?php echo $rows; ?> <em>baris,</em><br />
  <strong>Anda Memilih</strong> <?php echo $columns; ?> <em>kolom,</em><br />
  <strong>Dan Anda Membutuhkan</strong> <?php echo $cells; ?> <em>sel,</em><br />
  <br />
  <br />
  <?php
    $width = $columns * 100;
    echo "<table width=".$width." border=1>";
    $rw = 0;
    $cel = 1;
    while ($rw < $rows && $cel <= $cells)
    {
        echo "<tr>";
        $cl = 0;
        while ($cl < $columns)
        {
            if ($cel <= $cells)
            {
                echo "<td><div align=center>".$cel."</div></td>";
                $cel++;
            }
            $cl++;
        }
        echo "</tr>";
        $rw++;
    }
    echo "</table>";
?>
</div>

</body>
</html>

ini merupakan HTML

body {
margin: 10px auto;
width: 750px;
}

header{
border:1px solid green;
height: 80px;
}

nav {
border:1px solid blue;
height:20px;
}

section{
padding:15px;
border:1px solid red;
height:370px;
}

article{
float:left;
border:2px dashed red;
height:340px;
width:550px;}

aside{
float:right;
border:2px dashed black;
height:340px;
width:150px;
}

footer{
border:1px solid green;
height:20px;
}

HASILnya..


Jika dKLIK GENERATE, maka ..





Floodie
*dposting dg terpaksa untuk memenuhi syarat UTS besug. -.-"
ampun mas asdos :D