Muddy_Funster Posted October 12, 2011 Share Posted October 12, 2011 For that kind of layout you would be better using CSS. I don't think that you can nest tables within table cells (never tried) so I don't see you getting the layout that you are looking for without CSS. if you just want to use your current table and add another product listing on the same row change the contents of the while loop to include an if statement that will check and set a second product on the same row before droping down to the next we can use that little $i variable that's just hanging about at the top of the loop: $i = 0; echo = "<table><tr>"; while ($row = mysql_fetch_array($result_set)) { echo"<td>{$row['product_id']}</td><td>{$row['product_title']}</td><td>{$row['product_Description']}</td><td>{$row['product_price']}</td>"; if ($i >= 1){echo "</tr><tr>"; $i = 0;}else{$i = $i++;} } echo "</tr></table>"; Quote Link to comment https://forums.phpfreaks.com/topic/248573-unexpected/page/2/#findComment-1278680 Share on other sites More sharing options...
mindapolis Posted October 12, 2011 Author Share Posted October 12, 2011 it 's closer but now its 5+ columns instead of 2 columns like I would like. Is there anyway to set it to just 2 columns? Quote Link to comment https://forums.phpfreaks.com/topic/248573-unexpected/page/2/#findComment-1278702 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.