Ver Mensaje Individual
  #3 (permalink)  
Antiguo 12/11/2015, 06:24
Avatar de xfxstudios
xfxstudios
 
Fecha de Ingreso: junio-2015
Ubicación: Valencia - Venezuela
Mensajes: 2.448
Antigüedad: 8 años, 10 meses
Puntos: 263
Respuesta: NO me imprime dentro de una tabla

el tbody es el problema, al menos hasta donde se ver, prueba asi:
Código PHP:
Ver original
  1. echo '<table class="table  table-bordered table-striped datatable"  id="table-2">';
  2. echo    '<thead>';
  3. echo        '<tr class="success" >';
  4. echo            '<th>Contrato</th>';
  5. echo            '<th>Cliente</th>';
  6. echo            '<th>Matricula Tractora</th>';
  7. echo            '<th>DNI PASAPORTE</th>';
  8. echo            '<th>Matricula Remolque</th>';
  9. echo            '<th>Nombre</th>';
  10. echo            '<th>Estado</th>';  
  11. echo        '</tr>';
  12. echo    '</thead><tbody>';//AQUI INICIAMOS EL BODY
  13. function muestraEstado($estado)
  14. {
  15.     if($estado === 'Confirmada') {
  16.         echo '<button type="button" class="btn btn-success">
  17.            <i class="entypo-check"></i>
  18.        </button>';
  19.     } else {
  20.         echo $estado;
  21.     }
  22. }
  23.  
  24. if (is_array($distribuciones)) {
  25.  foreach($distribuciones as $distrib) {
  26.  
  27.  echo '
  28.        <tr>
  29.            <td>'.$distrib->Contrato.'</td>
  30.            <td>'.$distrib->Cliente.'</td>
  31.            <td>'.$distrib->Matricula_tractora.'</td>
  32.            <td>'.$distrib->DNI_conductor.'</td>
  33.            <td>'.$distrib->Matricula_remolque.'</td>
  34.            <td>'.$distrib->Nombre_conductor.'</td>
  35.            <td>'.muestraEstado($distrib->Estado).'</td>  <---------------- esto deberia imprimrlo en la tabla
  36.            </tr>';        
  37.  
  38.   }    
  39. }
  40. echo '</tbody></table>';//AQUI CERRAMOS EL BODY
__________________
[email protected]
HITCEL