Jump to content

I want to create thumbnail but facing problems


Inayat

Recommended Posts

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

 

 

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/

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;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.