I'm trying to create a very basic multiplication table without the actual table element, but not sure how to space the numbers correctly (without using css or an html table!). What's the simplest way to do this?
<?php
for ($i=1; $i < 11 ; $i++) {
for ($x=1; $x< 11 ; $x++) {
echo $i*$x . " ";
}
echo "<br>";
}
?>
Is this good enough
> <?php for ($i=1; $i < 11 ; $i++) {
> for ($x=1; $x< 11 ; $x++) {
> $output = $i*$x;
> if($output >= 10){
> echo $output . str_repeat(' ', 4);
> } else{
> echo $output . str_repeat(' ', 6); ;
> }
> }
> echo "<br>"; } ?>
OUTPUT