jeudi 3 décembre 2015

How to make an HTML table, which is automatically create new row after six item in column?

I'm trying to make my own site and I don't know how to better dispay images from database. I want to display six images in one row, but the next six item I want to display in second row. How can I make it with this code?

<table width="80%">
<% @products.each do |product| %>
    <td>
        <%= product.price %>"> <%= image_tag(product.image_url) %> </td>
<% end %>
</table>

Sorry, if this question is really stupid. But I'm just learning and It will help me understand Ruby better.

Aucun commentaire:

Enregistrer un commentaire