Forum Moderators: coopster

Message Too Old, No Replies

Create tables 2 rows at a time

         

wesg

1:48 pm on Jun 8, 2010 (gmt 0)

10+ Year Member



I'm building an inventory page with PHP/MySQL and I'd like to build a table that contains a photo in the top row, and a title at the bottom of the cell that is aligned with all the other titles. The trouble is that some photos are different aspect ratios so the titles are not aligned properly. Is it possible for me to build a table by adding 2 rows at once, and still build left to right? I've tried nested tables but that didn't have the desired effect. I may end up going through the array one at time, but i'm hoping to avoid that.

StoutFiles

2:14 pm on Jun 8, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Have a fixed width table and center all the content in the rows?

Matthew1980

2:16 pm on Jun 8, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi there wesg,

Why not use the gd library function set that php has to do you some thumb nail type images so that you can specify your image height & width, then you shouldn't have any misaligned cells/rows, just a thought there.

Cheers,
MRb

wesg

3:03 pm on Jun 8, 2010 (gmt 0)

10+ Year Member



I took all the suggestions, and used a different approach. Originally my image resize script resized based on width. I've modified it so it now resizes based on height, and my titles now line up. It still looks best if the images are the same aspect ratio, but this will work.

Thanks!