based on the example you gave, i would be more inclined to use lists and divs than tables. I would use something along the lines of
$colcounter = 0;
$numcols = 3;
echo "<ul>";
while ($row = mysql_fetch_array($result))
{
$colcounter++;
echo "<li class=\"column_".$colcounter."\"><div><!--business card display--></div></li>";
if ($colcounter==$numcols) $colcounter = 0;
}
echo "</ul>";
You should then end up with something like
<ul>
<li class="column_1"><!--business card display--></li>
<li class="column_2"><!--business card display--></li>
<li class="column_3"><!--business card display--></li>
<li class="column_1"><!--business card display--></li>
<li class="column_2"><!--business card display--></li>
<li class="column_3"><!--business card display--></li>
</ul>
which can be formatted to give the view you want using css.
Alternatively if you definitely want tables its pretty similar. You just need an extra bit for the row. You should also pad out eny empty tables (eg if you have 7 results you should really add an additional 2 td's
$colcounter = 0;
$numcols = 3;
echo "<table>";
while ($row = mysql_fetch_array($result))
{
//this is where we start a new row
if ($colcounter==0) echo "<tr>";
$colcounter++;
echo "<td class=\"column_".$colcounter."\"><div><!--business card display--></div></td>";
if ($colcounter==$numcols)
{
//this is where we end a row
$colcounter = 0;
echo "</tr>";
}
}
//check if we need any additional tds and if so add them on the end
if ($colcounter > 0)
{
while ($colcounter <= $numcols)
{
echo "<td> </td>";
$colcounter++;
}
echo "</tr>";
}
echo "</table>"
Hope this helps