Wrap the result in another table.
echo "<table>";
$count = 0;
$num_columns = 2; // or 3
while ($rc = mysql_fetch_array($results_course)) {
if ($count++ % $num_columns == 0) {
echo "<tr>";
}
echo "<td>";
// previous table code here
echo "</td>";
if ($count % $num_columns == 0) {
echo "</tr>";
}
}
if ($count % $num_columns > 0) {
echo "</tr>";
}
echo "</table>";
solved Set tables as side by side instead of straight down while doing a while-loop