Hey there,
I’m trying to create a multiplication table that looks like the image I attached.
So far this is my code
<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 //EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns = "http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<?php
$start = 15;
$end = 30;
echo '<table>';
echo '<tr><th></th>';
for ($x = $start; $x <= $end; $x++)
echo '<th>'.$x.'</th>';
echo '</tr>';
for ($y = $start; $y <= $end; $y++):
echo '<tr><th>'.$y.'</th>';
for ($z = $start; $z <= $end; $z++):
echo '<td>'.($y * $z).'</td>';
endfor;
echo '</tr>';
endfor;
echo '</table>';
?>
</body>
</html>
but I’m not sure this is the best approach.
any help would be appreciated.