I want to put two ore more images together (in a line) using php. How can I do that?
I want to put two ore more images together (in a line) using php. How can I do that?










Do you want any gap between the images or right parallel to each other? I think provided you don't and a <BR>or<P> tag between the images they will automatically be next to each other. Alternatively if you want a space between each one you should be able to do this with tables. I might be wrong though so dont hold me on it lol.
That would be extremely easy, but I need to make it a big image. I was playing with imagecopymerge but could not find a way to put images one next to another. I will have 5 images to put one next to another and one under these.
You can use this code:
You can repeat the <td> </td> parts to add new images to the same line. You can copy the whole <tr> </tr> part to add a new line of images below the first, but always stay inside the <table> tags.<table width="600" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<img src="http://URL-PHOTO-URL.com">
</td>
<td>
<img src="http://URL-PHOTO-URL.com">
</td>
<td>
<img src="http://URL-PHOTO-URL.com">
</td>
</tr>
</table>
Hope that helps!
princessa added 2 Minutes and 2 Seconds later...
<br> is a line break, which will cause anything written after the <br> to be on the next line down.![]()
Last edited by princessa; Feb 25th, 2009 at 2:13 am. Reason: Automerged Doublepost
Life is too short to wake up in the morning with regrets, so love the people who treat you right, forget about the ones who don't, and believe that everything happens for a reason. If you get a chance, take it. If it changes your life, let it. Nobody said life would be easy, they just promised it would be worth it.
Use <div></div>
If you give a better picture of what you exactly wanna do, I can help more..
Definitely use the div and css method as you can control the positions much better.
Plus css controlled pages are much quicker to load than table based sites.
As far as the php part is concerned, I assume you are taking the images from a database. If this is the case, you will need to create an array.
Put some more specific information and hopefully we can help
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks