Code: Select all
<html>
<table border="1">
<tr>
<th></th>
<?php
for($i=1; $i<=9;$i++){
echo "<th>", $i, "</th>"; //print the column header
}
?>
</tr>
<?php
for ($i=1; $i<=9; $i++){
echo "<tr>";
echo "<td><i><b>", $i, "</b></i>"; //print the row header
for ($j=1; $j<=9;$j++){
echo "<td>"; $k=$j*$i; echo $k; echo "</td>\n";
}
echo "</tr>\n";
}
?>
</table>
</html>