Do I need to create a grid with random numbers from a while loop?

0

I need to create a grid of 8 elements with the name of the items, the quantity and the price with random numbers, I have done this but I do not know how to form the grid.

<?php

$i = 0;

while ($i == 8) {
$i = rand(1,100);
echo $i."<br>;
$i++;
}
?>
    
asked by Sora Kasugano 15.04.2018 в 09:05
source

1 answer

1

I guess you want something like this:

   <table>
   <tr><td>Nombre</td><td>Cantidad</td><td>Precio</td></tr>

   <?php
   $i = 1;
   while ($i <= 8) { echo $i++
        echo "<tr>
                 <td>Nombre".$a."</td>
                 <td>50</td>
                 <td>".(rand(1,100))."</td>
              </tr>";
    }
    ?>

    </table>
    
answered by 15.04.2018 в 11:41