Show the table header with each new table row

0

I'm generating a table using php and bootsstrap, with each new row in the table, I want to show the table header again so it does not confuse the information, it follows the table and header code:

Header:

<table class='table table-striped'>
<tr>
 <th>Editar</th>
 <th>ID</th>
 <th>Tipo</th>
 <th>Entrada em milímetros</th>
 <th>Saída em milímetros</th>
 <th>Tamanho F</th>
 <th>Tamanho M</th>
 <th>Tamanho G</th>
 <th>Tamanho GG</th>
 <th>Foto do aparelho</th>
 <th>Foto do acabamento</th>
 <th>Foto Maquina</th>
 <th>Foto Maquina</th>

Table:

        print "<tr>";
         print "<td><button id='editarTamanho'name='editarTamanho' value='".$id_tamanho."' type='submit' class='btn btn-default glyphicon glyphicon-pencil'><strong>Editar<strong></button></td>";
         print "<td>".$id_tamanho."</td>";
         print "<td>".$resultado_nome_componente[0]."</td>";
         print "<td>".$entrada."</td>";
         print "<td>".$saida."</td>";
         print "<td>".$f."</td>";
         print "<td>".$m."</td>";
         print "<td>".$g."</td>";
         print "<td>".$gg."</td>";
         print "<td><img src='data:image/jpeg;base64,".base64_encode($foto_aparelho)."' height='150' width='150' alt=''></td>";
         print "<td><img src='data:image/jpeg;base64,".base64_encode($foto_acabamento)."' height='150' width='150' alt=''></td>";
         print "<td><img src='data:image/jpeg;base64,".base64_encode($foto_maquina1)."' height='150' width='150' alt=''></td>";
         print "<td><img src='data:image/jpeg;base64,".base64_encode($foto_maquina2)."' height='150' width='150' alt=''></td>";
        print "</tr>";

What do I need:

 Cabeçalho-------------------------------------------
 Dados-----------------------------------------------
 Cabeçalho-------------------------------------------
 Dados-----------------------------------------------
 Cabeçalho-------------------------------------------
 Dados-----------------------------------------------

And so on.

    
asked by anonymous 27.02.2017 / 20:02

1 answer

0

Will the table and the rows be placed in a loop (for, while)? If the header can be a line inside the tag. Just below you will add another line that will be the table inside the tags.

being more or less like this:

<table class='table table-striped'>

?>
<tr>
 <th>Editar</th>
 <th>ID</th>
 <th>Tipo</th>
 <th>Entrada em milímetros</th>
 <th>Saída em milímetros</th>
 <th>Tamanho F</th>
 <th>Tamanho M</th>
 <th>Tamanho G</th>
 <th>Tamanho GG</th>
 <th>Foto do aparelho</th>
 <th>Foto do acabamento</th>
 <th>Foto Maquina</th>
 <th>Foto Maquina</th>
</tr>

print "<tr>";
print "<td><button id='editarTamanho'name='editarTamanho' value='".$id_tamanho."' type='submit' class='btn btn-default glyphicon glyphicon-pencil'><strong>Editar<strong></button></td>";
print "<td>".$id_tamanho."</td>";
print "<td>".$resultado_nome_componente[0]."</td>";
print "<td>".$entrada."</td>";
print "<td>".$saida."</td>";
print "<td>".$f."</td>";
print "<td>".$m."</td>";
print "<td>".$g."</td>";
print "<td>".$gg."</td>";
print "<td><img src='data:image/jpeg;base64,".base64_encode($foto_aparelho)."' height='150' width='150' alt=''></td>";
print "<td><img src='data:image/jpeg;base64,".base64_encode($foto_acabamento)."' height='150' width='150' alt=''></td>";
print "<td><img src='data:image/jpeg;base64,".base64_encode($foto_maquina1)."' height='150' width='150' alt=''></td>";
print "<td><img src='data:image/jpeg;base64,".base64_encode($foto_maquina2)."' height='150' width='150' alt=''></td>";
print "</tr>";
<?php
}

    
28.02.2017 / 15:26