Are you saying you want 3 images per table row?
If this is what you want to do, you may also want to change your limit on the query results to 6.
Then you would put your table creation inside of a php loop:
<?php
$totalResults=mysql_num_rows($yourQuery);
$numberOfImagesPerRow=3;
$numberOfRows=$totalResults/$numberOfImagesPerRow;
echo "<table">;
for($x=0;$x<$numberOfRows;$x++)
{
echo "<tr>";
for($i=0;$i<$numberOfImagesPerRow;$i++)
{
echo "<td>";
//picture display code here
echo "</td>;
}
echo"</tr>";
}
echo "</table>";
?>
And if that isn't what you want to do, well now you know how to do that!