This confused me for a while too until I stumbled upon this and it became very easy. Now this is straight from my code so you'll have to adapt it to your needs but you'll understand the layout as to how to make it work from this.
PHP Code:
$column = 4;
$rowend = 1;
echo "<table cellspacing=\"6px\" style=\"width:100%\"><tr>";
$get_brands = mysql_query("SELECT * FROM brands WHERE active='1' AND is_atv='0' ORDER BY brand ASC");
while ($the_brands = mysql_fetch_array($get_brands))
{
$b_id = $the_brands['id'];
$b_name = $the_brands['brand'];
$b_img = $the_brands['brand_logo'];
echo "<td><a href=\"wheels.php?brand=$b_id\"><img src=\"$b_img\" alt=\"$b_name\"/></a></td>";
if ($rowend == $column){ echo "</tr><tr>"; $rowend=0;}
$rowend++;
}
echo "</tr></table>";
Bookmarks