Skip to content

Instantly share code, notes, and snippets.

@releu
Created March 20, 2012 08:13
Show Gist options
  • Save releu/2132703 to your computer and use it in GitHub Desktop.
Save releu/2132703 to your computer and use it in GitHub Desktop.
printing table #3
<table>
<% @hash.keys.each do |key| %>
<th>key</th>
<% end %>
<% @hash.values.max_by(&:size).size.times do |i| %>
<tr>
<% @group.values.map { |a| a[i] }.each do |value| %>
<td><%= value %></td>
<% end %>
</tr>
<% end %>
</table>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment