How could I structure the following code adequately to achieve these results? I'm a bit lost with the PHP theme to "merge" with the html. If it is 4x4 it shows 16 numbers, the odd ones in green and the pairs in red.
<html>
<head>
<meta charset="UTF-8">
<title>Dibujando tabla</title>
</head>
<body>
<?php
if(isset($_POST["enviar"]) && (!empty($_POST["filas"])) && (!empty($_POST["columnas"]))) {
$filas=$_POST["filas"];
$columnas=$_POST["columnas"];
$incremento=1;
for ($j=1; $j<=$filas; $j++) {
for ($i=0; $i<=columnas; $i++) {
$multiplica=$incremento*$i;
echo $incremento. "x" .$i. "=" .$multiplica. "<br>";
print("<td>" .$incremento[$filas][$columnas]. "</td>");
}
$incremento++;
echo "<br>";
}
}else {
?>
<form name="formulario" action=' <?php echo $_SERVER['PHP_SELF']?>' method="post">
<div>
<label for="name">Indica el número de filas: </label>
<input type="number" name="filas"/>
</div>
<div>
<label for="name">Indica el número de columnas: </label>
<input type="number" name="columnas"/>
</div>
<input type="submit" value="enviar" name="enviar">
<input type="reset" value="Borrar" name="Borrar">
</body>
</html>
<?php
}
?>