Inayat Posted September 27, 2013 Share Posted September 27, 2013 I want to create thumbnail but facing problems, I want to display image of mobile phone, and model number, brand name, os and some other features as one thumbnail, and I want to place minimum 6 thumbnails in one row, mean six records in one rwo, and I want to call minimum 90 records in 15 columns but I don't know how to display these recoreds because if I am apllying while { <div> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> </div> } then these records are being displayed in one line, mean in one column or in one row, while I want to create 6 cells in one row and 15 cells in one colum. please help Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted September 27, 2013 Share Posted September 27, 2013 You still need to use some form of loop. You need to add extra logic in your loop in order for x amount of columns to be outputted in a row. Have a look at link below for examples. http://forums.phpfreaks.com/topic/11572-multi-column-results/ Quote Link to comment Share on other sites More sharing options...
Barand Posted September 27, 2013 Share Posted September 27, 2013 Using floating divs is the easiest way. Here's a simple example $a = range(1,90); // array of your data $i = 0; foreach ($a as $data) { echo "<div style='height:80px; width: 100px; font-size: 40pt; text-align: center; float: left; border: 1px solid black;'> $data </div>"; if ($i%6 == 5) { echo "<div style='clear:left'></div>"; } ++$i; } 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.