Hi,

I have a fastcsv collection (2d array) that I want to display as a
table.  I figured the best way would be a helper function, and build
the table dynamically.

    table = content_tag(:table,
       #tbody begind
       content_tag(:tbody,
           #tr begin
           collection.collect{|row| content_tag(:tr,
               #td begin/end
               row.collect{|field| content_tag(:td, field)},
           :class => cycle('list-line-odd', 'list-line-even'))} #tr
end
       ), #tbody end
    :class => 'grid')  #table end

That works really well until I get to the point where I want to add a
thead or a tfoot.   Is the best way to use a helper for each section
rather than doing the entire table?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to