Show table header for each new table row

Asked

Viewed 34 times

0

I am generating a table using php and bootsstrap, every new row of the table, I want to show the table header again so as not to confuse the information, follows the code of the table and the header:

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 I need:

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

And so on and so forth.

1 answer

0

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

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
}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.