情報処理実習3B(Web)

2017年度 前期 木04 15:15-16:45 瀬田2-119

課題

04.loops/kuku.php

表示
ソース

<?php
$max_length = 9;
?>
<!DOCTYPE html>
<html lang="ja">
<head>
   <meta charset="UTF-8" />
   <meta name="viewport" content="initial-scale=1.0">
   <title>九九</title>
   <style>
table{
   border-collapse:collapse;
}

th,td{
   border:solid 1px black;
   text-align:center;
}

th{
   background:lavender;
}
   </style>
</head>
<body>
<h1>九九表</h1>
<table>
<caption>九九</caption>
<col span="10" style="width:2em;">
<tr>
<?php
for($column = ""; $column <= $max_length; $column++){
?>
<th><?php print $column; ?></th>
<?php
}
?>
</tr>
<?php
for($row = 1; $row <= $max_length; $row++){
?>
<tr><th><?php print $row;?></th>
<?php
    for($column = 1; $column <= $max_length; $column++){
?>
<td><?php print 0; ?></td>
<?php
    }
?>
</tr>
<?php
}
?>
</table>
</body>
</html>