gracias por el aporte pero tengo el siguiente problema, no me maqueta a 4 columnas y 3 filas, se ven todas una al lado de otra.. cual sera el problema:
Código PHP:
$columnas = 4;
$filas = 5; // OK?
// luego, para facilitar esto usaremos dos for() anidados
echo "<table cellpadding='10' cellspacing='0' align='center'>";
// Primero, debemos ver nuestros elementos...
for ($x = 0; $x < $filas; ++$x)
{
// "vector" X
echo '<tr>';
for ($y = 0; $y < $columnas; ++$y)
{
while ($row=mysql_fetch_assoc($resultados))
{
echo '<td>';
// rutinas....
echo " <form method='post' action='' class='jcart'> ";
echo " <input type='hidden' name='my-item-id' value='$d' />";
echo " <input type='hidden' name='my-item-name' value='$row[titulo]' />";
echo " <input type='hidden' name='my-item-price' value='$row[precio]' />";
echo "<b>$row[titulo]</b><br /><img src='$row[imagen]'width='150' height='150' class='bor' /><br /><img src='images/icon.gif' /> Precio: $$row[precio]<br> <img src='images/icon.gif' /> Cantidad: <input type='text' name='my-item-qty' value='1' size='3' /> <br> ";
$d++;
if($_SESSION['id'])
{echo "<input type='submit' name='my-add-button' value='Comprar' class='button' />";
}
else
{
echo "<span style='color:red;border:1px solid red;padding:2px'>Inicie Sesión</span>";
}
echo "<div class='dash3'></div>";
echo " </form>";
echo '</td>';
}
// cerramos X
echo '</tr>';
echo '</table>';
}
}
necesito que se vean en filas
gracias