tpass Posted November 1, 2014 Share Posted November 1, 2014 Hello - hope you are all well. I am creating a website for a family friend who has a shop. See preview of the site in this picture .... Currently the results are showing in one column. I want to show them in three columns in the format of: 1 2 3 4 5 6 7 8 9 etc But formatted with the picture and then the title and the border. The current code i have is.... HEAD <?php $sql = "SELECT * FROM abs_productcat WHERE catid = $catid ORDER BY catid ASC";$can = mysql_query($sql);$catname = mysql_fetch_assoc($can); ?> BODY <?php while ($row_pro = mysql_fetch_assoc($rs_proddetails)) { ?><tr> <td><table width="243" border="0" align="left" cellpadding="15" cellspacing="0" class="sectionborders"> <tr> <td height="120" align="center"><p><strong><a href="indproducts.php?ProductID=<?php echo $row_pro['ProductID']; ?>"><img src="products/product_<?php echo $row_pro['ProductID']; ?>" alt="<?php echo $row_pro['ProductName']; ?>" height="120" class="sectionborders" border="0" /></a></strong></p> <p><strong><a href="indproducts.php?ProductID=<?php echo $row_pro['ProductID']; ?>" class="products"><?php echo $row_pro['ProductName']; ?></a></strong></p></td> </tr> </table></td> </tr> <tr> <td> </td> </tr> <?php } ?> THANK YOU FOR YOUR HELP!!! Quote Link to comment https://forums.phpfreaks.com/topic/292208-php-results-into-columns/ Share on other sites More sharing options...
mogosselin Posted November 1, 2014 Share Posted November 1, 2014 Tip: you can use the <> icon in the tool bar to post your code, so that it will have syntax highlight and will be easier to read. The first step for you would be to try to achieve the result in pure / hardcoded HTML first. Try to do this, then try to apply it to your PHP code. Quote Link to comment https://forums.phpfreaks.com/topic/292208-php-results-into-columns/#findComment-1495453 Share on other sites More sharing options...
Ch0cu3r Posted November 1, 2014 Share Posted November 1, 2014 Take a look here for some examples http://forums.phpfreaks.com/topic/11572-multi-column-results/ Quote Link to comment https://forums.phpfreaks.com/topic/292208-php-results-into-columns/#findComment-1495464 Share on other sites More sharing options...
Solution Barand Posted November 1, 2014 Solution Share Posted November 1, 2014 I find it easier to use divs with a float:left and width ~30% of the enclosing area. Quote Link to comment https://forums.phpfreaks.com/topic/292208-php-results-into-columns/#findComment-1495471 Share on other sites More sharing options...
tpass Posted November 2, 2014 Author Share Posted November 2, 2014 Thank you so much for your help all. I have gone down the Div route, thank you Barand!! Quote Link to comment https://forums.phpfreaks.com/topic/292208-php-results-into-columns/#findComment-1495530 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.