How to create a dynamic html table for resultset iteration?

Hello all, I have create a simple photo gallery. Currently I can display
one photo per row in my table. I would like to learn how to have 3 or
more photos per row in my table. I have tried doing
an inner for loops, using 3.times, but ended up with my photo being
copied 3 times per row. Any one have a suggestion on this?

Thanks.

So you want to print out the appropriate td and tr tags right? And
you’re using partials? There are a few ways to do this.

If you’re doing something like
<%= render :partial => “photo”, :collection => @photos %>
you can use photo_counter in your _photo.rhtml to determine when to
print out the appropriate tr and td tags.

You could also render a partial and pass it an :object.
<%= render :partial => “photo”, :object => @photos %>
Then in your _photo.rhtml you can iterate over @photos any way you like.