Jump to content

Help... on displaying my image horizontally and wrap on my webpage


ACwarrior

Recommended Posts

I need to display my images horizontally on my webpage... My script as below..

 

<?php

require("functions.inc.php");

?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>My Love Photo</title>

</head>

 

<body>

<?php

displayPhoto("photo", "200"); ?>

</body>

</html>

 

But.... The Image appear:

Image1

Image2

Image3

Image4

.

.

.

.

.

Image200

 

I need the image to appear like this:

 

Image1 Image2 Image3 Image4 Image5

Image6 Image7 Image8 Image9 Image10

Image11 Image12

 

Please kindly advise!! I m a Noob!

I seen that link and i try to work with it and end up more errors...

 

Can anyone help with what i have?

 

Ok !!! in that link we output only 3 images in a row. Let's assume you want 6 pictures in a row. then all you need to do is change

 

if($i > 3){
echo "<tr>";
}
..
..
..
if($i >2){
echo "</tr>";
}

 

into

if($i > 6){ // you can limit it whit how many picture you want to output in a row. if you want 10 pics then type 10
echo "<tr>";
}
..
..
..
if($i >5){ // make sure you initialize less then above if statement. if you want 10 pics then type 9
echo "</tr>";
}

hope this help

Add a css style

 

img
{
  display: inline;
}

 

Now the images wont force a new line before/after they'll line up next to each other.  When the edge of the page is reached they should automatically jump down a level.

 

This is more an HTML question than a PHP though isn't it?

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.