The problem is that you are creating several independent tables (look at the source of your page to better understand).
Take the table structure out of the loop, so it will have multiple rows in the same table:
<table class='centered' >
<thead>
<tr>
<th>Nome</th>
<th>Telefone</th>
<th>Email</th>
</tr>
</thead>
<tbody>
<?php
foreach ($registro as $reg){
echo "\t\t<tr>";
echo "\t\t\t<td>".$reg['nome']."</td>";
echo "\t\t\t<td>".$reg['telefone']."</td>";
echo "\t\t\t<td>".$reg['email']."</td>";
echo "\t\t</tr>";
}
?>
</tbody>
</table>
Note that I added some \t
us echo
To indent, you don’t have to do this, and if you do, put as much as necessary to align right with the rest of HTML (to help you understand). The \t
is the tab character, you can switch to blank spaces.
gave everything right here, thank you so much for your valuable help
– Sarah Leesy