A quick search for “php image gallery” or “php free image gallery” returns a ton of records. What exactly out of those results don’t give you what you want?
Ask the client if the images will be consistent in ratio or size. If they will not, then that may limit your options Not wise to assume.
Does your client expect you to learn from the ground up, or use existing tools to get the job done faster?
The easiest way to make a grid is to use a table (though I may be flamed by CSS purists). It’ll be a good idea to find out how many images he expects to show on a page before thinking of an image gallery. 4? 8? 11? Large? Small? Make a comp and show it before coding it.
And correctly so. If you want to do tables but you have non tabular data, you need to use the CSS equivalent: display:table/table-cell. That preserves semantics.
After kicking things around today, this much I can say…
Photos in the gallery will come from a digital camera, and so they will either be landscape or portrait in orientation and aspect ratio. I would expect the majority of photos to be landscape, but not always.
What is the best way to present pictures when there can be a random combination of each orientation in a single gallery?
No - a table is for tabular DATA not a tabular format.
Millions of websites are in a grid format - but htey do it semantically without tables since that’s the correct thing to do. You are advocating a terrible approach and I question it.
Image if you were at the kitchen table with prints from your latest vacation. There were 12 pictures, and 7 of them were landscape and 5 were portrait. How would you lay them out o the table so they didn’t look awkward?
You could try grouping all landscape pictures together and then place the portrait ones at the end, but that would be a lot of work programmatically for a website, plus if you want pictures displayed chronologically, then that wouldn’t work.
Maybe there just isn’t a way to make such an assortment of photos look “pretty”.
The only idea I have is to create some parent container for each picture, and make it a square (e.g. 180 x 180). The squares would be laid out in an even larger parent container representing your page, and then inside each square you could flip the orientation, say 180x120 or 120x180 and the square wouldn’t care.
So the page would be a grid of maybe 5 squares wide and however many tall, and you could flip the individual pictures any way you want.
Things would layout fine as far as the browser is concerned, but you would still have the issue that I am really asking about which is this weird looking assortment of photos on a page.
Since you seem to be one of the many experts here, do you have any comments on my last post?
Where I seem to be most confused with how to make a page with a random combination of landscape and portrait pictures look visually appealing without lots of ugly dead-space. (There probably isn’t a way to completely fix this, but from a technical standpoint my square idea above was the best I could think of.)