Hi all,  This is probably something dumb I'm missing, but I am using the
following code:

echo "<table border=\"0\">\n";

echo "<tr>\n";
$photocount = 0;

while($row = mysql_fetch_array($result)) {
     $smallpic = $row['smallpic'];

 if (($photocount % 3) == 2) {
     echo "</tr>\n<tr>\n";
 }

 echo "<td>$smallpic</td>\n";
 $photocount++;

     }

echo "</tr>\n";

echo "</table>";

and it's outputting a table like this:

<table border="0">
<tr>
<td>sm982438092.gif</td>
<td>sm982437452.gif</td>
</tr>
<tr>
<td>sm982439016.gif</td>
<td>sm982529915.gif</td>
<td>sm983222652.gif</td>
</tr>
<tr>
<td>sm983222686.gif</td>
<td>sm983222868.gif</td>
<td>sm983222919.gif</td>
</tr>
</table>

(There are currently 8 pics that have been uploaded).  As you can see that
the first row has returned just two columns.  I'd like the photos to be
displayed in rows of three, and if there are only 8 pictures (or any othe
number that's not directly divisible by three) to be displayed on the last
row.   At the moment it's doing it "upside down."  Any ideas?

And I know, I'm going to have to force an extra cell for it to display
correctly....


Thanks as always,
James.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to