Prova una cosa del genere, è bruttino come codice ma rende l'idea:

Codice PHP:
$column 1;
print(
"<table>");
$all mysql_query("SELECT * FROM allegati WHERE cliente = '$loc'");
while (
$servizi mysql_fetch_array($all)) {
    if (
$column == 1) {
        print(
"<tr>");
    }
    print(
"<td>".$servizi['allegato']."</td>");
    if (
$column == 3) {
        print(
"</tr>");
        
$column 1;
    } else {
        
$column += 1;
    }
}
if (
$column 3) {
    print(
"</tr>");
}
print(
"</table>"); 
P.S.
Non l'ho testato.