mardi 19 juillet 2016

Using Ruby on Rails, How can I put data in a new table line?

I'm a beginner in Ruby on Rails. And I'm korean. So my words are little weired... My question is this... If I have 10 data, I want to put 1~5th data in a first line and 6~10th data in a second line.

like this

I've try this codes

              <table border height=300 width=300 align=center>
                <thead>
                  <tr style="font size:20;">
                    <th></th>
                    <th></th>
                  </tr>
                </thead>

                <tbody>
                  <% if current_user.samulham.nil? %>
                    <tr>
                      <% @samulham.each do |x| %>
                         <% if x.user_id.present?%>
                           <td><%= "X" %></td>
                         <% else %>
                           <td><%= link_to "#{x.lockernumber}", {:controller => "home", :action => "register", :cur_user => current_user.id, :cur_samulham => x.id}, method: :post %></td>
                         <% end %>
                      <% end %>
                    </tr>
                  <% end %>
                </tbody>
              </table>

Thank you for your considering. :)

Aucun commentaire:

Enregistrer un commentaire