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> Link to comment https://forums.phpfreaks.com/topic/57106-beginner-needs-help-displaying-from-database/ Share on other sites More sharing options...
MasterACE14 Posted June 25, 2007 Share Posted June 25, 2007 thought about using HTML tables? Regards ACE Link to comment https://forums.phpfreaks.com/topic/57106-beginner-needs-help-displaying-from-database/#findComment-282333 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 Link to comment https://forums.phpfreaks.com/topic/57106-beginner-needs-help-displaying-from-database/#findComment-282345 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. Link to comment https://forums.phpfreaks.com/topic/57106-beginner-needs-help-displaying-from-database/#findComment-282362 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.