<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test 3</title>
</head>
<body>
<h1>Table de multiplication</h1>
<form action="" method="get">
  <div>
    <label for="n">Entier :</label>
    <input type="text" name="n" id="n">
</div>
</form>
<?php 
  $n
=$_GET["n"];

  if(isset(
$n)) { ?>
  <table>
    <caption>Table de multiplication</caption>
    <tr>
      <th></th> <?
    for($i=1;$i<=$n;$i=$i+1) {
      echo "<th>$i</th>";
    } 
    echo "</tr>";

    for($i=1;$i<=$n;$i=$i+1) {
      echo "<tr><th>$i</th>";
      for($j=1;$j<=$n;$j=$j+1) {
        echo "<td>".$i*$j."</td>";
      }
      echo "</tr>";
    }
    ?>
  </table><?
  }
?>
</body>
</html>