Ver Mensaje Individual
  #5 (permalink)  
Antiguo 21/10/2011, 10:35
Rasec101
 
Fecha de Ingreso: diciembre-2009
Ubicación: Santiago, Chile
Mensajes: 143
Antigüedad: 14 años, 5 meses
Puntos: 2
Respuesta: listar en dos columnas checkbox dinamicos

Cita:
Iniciado por gamau6 Ver Mensaje
Lo que se hace es dividir en dos tablas el resultado

algo asi

Código PHP:
Ver original
  1. <?php if ($izq) {?>
  2.         <tr><?php }?>
  3.         <td>
  4.         <?php echo $variable['dato'];?> </td>
  5.         <?php if (!$izq) {?></tr><?php }?>
GRACIAS gamau6 lo solucione con la idea que me diste este es el codigo
Código PHP:
Ver original
  1. <?                        
  2.                                        
  3.    
  4.                                                
  5.                                                 $clCategorias = new Categorias();
  6.                                                 $resCategorias = $clCategorias->ListarCategoria();
  7.                                              
  8.                                                  echo "<tr><td rowspan='".count($resCategorias)."' valign='top'> INTERESES</td>";
  9.                              
  10.      
  11.      
  12.                                                       if(count($resCategorias) > 0)
  13.                                                 {
  14.                                                     foreach($resCategorias as $cat)
  15.                                                     {
  16.                                                         $i++;
  17.                                                       $izq = $i % 2;
  18.                                                         $indi = $cat["idCategoria"];
  19.                                                               if ($izq) {
  20.                                                        echo" <tr>"; }
  21.                                  
  22.                                                             echo"<td>
  23.                 <input id='checkbox' name='ArregloCategorias[]' type='checkbox' value='".$cat["idCategoria"]."'></td><td>".$cat["nombre"]."</td>";
  24.                                
  25.                                                        
  26.                                                        if (!$izq) { echo "</tr>";}
  27.                                                      
  28.                                                     }
  29.                                                 }
  30.                                                
  31.                                                 ?>