PHP

PHP 乘法口诀制作

2020-04-24  本文已影响0人  887d1fc86fe6
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <table border="1" width="800" height="400">
  <?php
    for ($i = 1; $i <= 9; $i++) {
     echo '<tr>';
     for ($k = 1; $k <= $i; $k++) {
       $s = $k * $i;
       echo "<td style='text-align: center'>$k * $i = $s</td>";
     }
     echo '</tr>';
    }
  ?>
  </table>
</body>
</html>
上一篇 下一篇

猜你喜欢

热点阅读