A ver si entiendo lo que pides:
En el while o foreach según como lo tengas:
Código PHP:
<table>
<tr>
<?php
$i=1;
while ($registros = tu_consulta)
{
?>
<td><?= $registros['campo'] ?></td>
<?php
if ($i % 3 == 0)
{
echo "</tr><tr>";
}
$i++;
}
?>
</tr>
</table>
va creando celdas linealmente, cuando se crean 3 se forma una nueva fila.