开发者

Display an array into multiple columns on the page

开发者 https://www.devze.com 2023-01-24 03:05 出处:网络
I have 开发者_高级运维an array \"$a\" and the below code in my view displays all the elements in a single column.

I have 开发者_高级运维an array "$a" and the below code in my view displays all the elements in a single column. How do I display them into 5 columns?

<ul>  
 <% for w in $a %>    
   <%= w %><br/>
 <% end %>  
</ul>


See this question Display 5 records per row?

 <% @tags.in_groups_of(5).each do |tag_array| %>
      <% tag_array.each |tag| %>
      will output 5 tags here
      <% end %>
 <% end %>
0

精彩评论

暂无评论...
验证码 换一张
取 消