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

 

 

Link to comment
Share on other sites

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;
}
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.