Ver Mensaje Individual
  #10 (permalink)  
Antiguo 23/05/2017, 15:36
Avatar de Briss
Briss
 
Fecha de Ingreso: junio-2011
Mensajes: 1.293
Antigüedad: 12 años, 10 meses
Puntos: 12
Respuesta: duplicar encabezado en tabla por número de registros

Hice lo siguiente : agregue al inicio los encabezados y salen bien, para dibujar el 6to renglón vacío compare $i

Código PHP:
  <table border="1">
  <thead>  <tr>
      <td>No.</td> 
      <td>Nombre</td> 
      <td>A. paterno</td> 
      <td>A. Materno</td> 
      <td>Email</td> 
  
   </thead> 
    </tr>

<?php 
$i
=0;
do { 
$i++;?> 
<tbody>
      <tr>
          <td><?php echo $i?></td> 
          <td><?php echo $row_docentes['Nombre']; ?></td> 
          <td><?php echo $row_docentes['ApellidoPaterno']; ?></td> 
          <td><?php echo $row_docentes['ApellidoMaterno']; ?></td> 
          <td><?php echo $row_docentes['Email']; ?></td> 
      </tr>   
    </tbody>
      
<?php if ($i<and $i>4) {?>
<tbody>
      <tr>
          <td><?php echo $i+1?></td> 
          <td></td> 
          <td></td> 
          <td></td> 
          <td></td> 
      </tr>   
    </tbody>

<?php ?>
<?php 
if ($i == 0) {?>
  </table>
  <table border="1" >
  <thead>  <tr>
      <td>No.</td> 
      <td>Nombre</td> 
      <td>A. paterno</td> 
      <td>A. Materno</td> 
      <td>Email</td> 
  
   </thead> 
    </tr>

<?php ?>
 
    <?php } while ($row_docentesmysql_fetch_assoc($docentes)); ?>
Mi tabla quedo así

https://ibb.co/i52sqv


No entiendo porque las dos primeras tablas salen juntas y en la ultima hay un espacio