第一种
<?php
echo '<table border = "1">';
for ($i=1; $i <=9 ; $i++) {
echo "<tr>";
for ($j=1; $j <= $i; $j++) {
echo "<td>$j*$i=".$i*$j."</td>";
};
echo "</tr>";
};
echo "</table>";
?>
第二种
echo "</table>";
echo '<table border = "1">';
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>";
};
echo "</table>";