jbrill Posted June 25, 2007 Share Posted June 25, 2007 hey, just need help to solve a simple question... I'm trying to display products that are pulled form a database in a certain way using only DIV tags I would like the products to display across the page in rows of 4, however when i use div tags it is just putting one on each row.. whats the best way to display in a row of 4? here is an example script of what im using to experiment with: <? include 'includes/dbconnect.php' ?> <div id="#productcontainer"> <? $allresult = mysql_query("SELECT * FROM products WHERE publish=1"); while($row = mysql_fetch_array($allresult)) { echo"<div style=\"width:200px; height: 200px; border: 1px solid #000000;\" >"; echo"<b>". $row['name'] . "</b>"; echo"</div>"; } ?> </div> Quote Link to comment Share on other sites More sharing options...
MasterACE14 Posted June 25, 2007 Share Posted June 25, 2007 thought about using HTML tables? Regards ACE Quote Link to comment Share on other sites More sharing options...
Pastulio Posted June 25, 2007 Share Posted June 25, 2007 Yes I'm affraid you are going to have to use a table. But if you really want you can put your div's seperately in each <td> of the table Quote Link to comment Share on other sites More sharing options...
per1os Posted June 25, 2007 Share Posted June 25, 2007 http://www.dev-archive.net/articles/table-in-css.html May help you out. Quote Link to comment 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.