This would get you four columns and as many rows as needed. I hope that helps and if anyone else has any suggestions feel free to correct me.
Array Style:
$row = array('1','2','3','4','5','6','7','8','9','10');
$num_columns = "4";
$count = "0";
echo "<table border='1'>";
foreach($row as $value){
$count++;
if($count == "1"){
echo "<tr>";
}
echo "<td>$value</td>";
if($count == "4"){
echo "</tr>";
$count = "0";
}
}
echo "</table>";
Database Style:
$sql = "SELECT quote FROM quotes";
$result = mysql_query($sql);
$num_columns = "4";
$count = "0";
echo "<table border='1'>";
foreach($row = mysql_fetch_array($result)){
$count++;
if($count == "1"){
echo "<tr>";
}
echo "<td>".$row["quote"]."</td>";
if($count == "4"){
echo "</tr>";
$count = "0";
}
}
echo "</table>";