My friend working on his cart needed the output to be in two columns, and since i'm having challenges similar to these all over here is exactly how I accomplished it. <?php $table_columns = 0; // set a default value so things don't get f-ed up, this may not be necessary tho while($r = $db->fetch_array($query)) { $Prod_Name = $r['Product_Name']; $Image_URL = $r['ImageURL']; $MSRP = $r['MSRP']; $path = "$Image_URL"; $file = basename($path, ".php"); $ImageCat = "images/thumbs/$file"; $pie = explode("-", $Prod_Name); ?> <table> <caption> Products</caption> < ?php if($table_columns == 2){$table_columns = 0;} // set the value back to zero to start a new column if($table_columns == 0){ echo"<tr>"; // this adds a column } echo"<td>"; echo $pie['1']; echo"<img src=\"$ImageCat\"/>"; echo"Desc"; echo"</td>"; if($table_columns == 1){ echo""; // this ends the column } $table_columns++;// increment the variable on each pass to make columns }</table>