Selasa, 08 Maret 2011

tugas web modul 6

tugas rumah 3 x 4

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>tugas web</title>
</head>
<body>
<h3 align="center">3 X 4</h3>
<div align="center">
<?php $rows = 4; ?>
<?php $columns = 3; ?>
<?php $sel =1 ?>
<?php

// mengalokasikan tabel
echo "<table border=2 width=200 height=200>";
$baris = 0;
while ($baris < $rows)
{
echo "<tr>";
$kolom = 0;
while ($kolom < $columns)
{

// menampilkan nomor dalam tabel
echo "<td><div align=center>".$sel."</div></td>";
$kolom++;
$sel++;
}
echo "</tr>";
$baris++;
}
echo "</table>";
?>
</div>
</body>
</html>

Tidak ada komentar:

Posting Komentar