Codice PHP:


$maxInRow 
5;
$i 0;

echo 
'<table width=".." ... >';

while (
$row_foto=mysql_fetch_array($foto)) {
   
if(
$i==0)
echo 
'<tr>';

echo 
'<td>...la mia foto...</td>';

$i++;

if(
$i==$maxInRow){
$i=0;
echo 
'</tr>';
}

}


if(
$i>0){

while(
$i<$maxInRow){
echo 
'<td></td>';
$i++;
}
echo 
'</tr>';