乘法口诀表
<?php
echo "<table border=1>";
for ($i=1; $i <= 9 ; $i++) {
echo "<tr>";
for ($j=1; $j <= $i; $j++) {
echo "<td>$j*$i = ".$j*$i."</td>";
}
echo "</tr>";
}
echo "</table>";
?>
<table>
<?php
for ($i=1; $i <= 9; $i++) {
echo "<tr>";
for ($j=1; $j <= 9; $j++) {
if ($j > $i) {
echo "<td></td>";
} else {
echo "<td>$j * $i = " . ($i * $j) . "</td>";
}
}
echo "</tr>";
}
?>
</table>
网友评论