程序运行截图如下:
源码如下:
- <table border="1" cellspacing="1" cellpadding="1">
- <?php
- $count = 9;
- for($i = 1; $i <= $count; $i++){
-
- echo "<tr>";
-
- for($j = 1; $j <= $i; $j++){
-
- echo "<td>";
- echo $j . " * " . $i . " = " . $j * $i;
- echo "</td>";
- }
-
- echo "</tr>";
- }
- ?>
- </table>