Ver Mensaje Individual
  #8 (permalink)  
Antiguo 04/09/2012, 18:03
Gerwal
 
Fecha de Ingreso: agosto-2012
Ubicación: Lima
Mensajes: 25
Antigüedad: 11 años, 8 meses
Puntos: 6
Respuesta: Nueva Línea en tabla cuando sobrepase X registros

Espero te sirva lo hice sin correrlo si te funciona super pero esa es la idea ^^,

Código PHP:
<?php $result mysql_query("SELECT * FROM articulos"); 
                 
//agrego contador ---- 
                
$i=0;
        if (
$row mysql_fetch_array($result)){ 
        echo 
"<table border = '0' width='100%' class = 'altrowstable' id = 'alternatecolor'> \n"
   echo 
"<tr>";
   do { 
          echo 
"<td><img src='./imagenes/articulos/".$row['imagen']."' width='150px' ></td> \n"
           } while (
$row mysql_fetch_array($result)); 
           echo 
"</tr></table> \n"//Aquí no se debería cerrar la tabla
                //le sumo 1 ---- 
                
$i++;
                 if(
$i%4==0){
                          
//si el residuo es 0 cierra y abre el td
                          
echo "</tr><tr>";
                  }
                  
        } else { 
        echo 
"No se han encontrado artículos"
        } 
        
?>