title: FasterCSV layout
body: <p>I need to layout my CSV into columns not rows. So going down the spreadsheet not across. For example:</p>
  
  <p>Header 1, value1.1, value2.1<br/>
  Header 2, value1.2, value2.2<br/>
  Header 3, value1.3, value2.3<br/></p>
  
  <p>Does anyone know how to do this? I've been through the documentation and can't find anything about changing the layout to columns.</p>
  
  <p>EDIT: </p>
  
  <pre><code>row_data = [];
  csv_string = FasterCSV.generate do |csv|
    # header row
    row_data &lt;&lt; ["id", "Name", "Age"]
  
    # data rows
    Playerapplication.find_each do |player|
      row_data &lt;&lt; [player.id, player.name, player.age]
    end
  
    row_data.transpose
    csv &lt;&lt; row_data
  end
  
  # send it to the browser
  send_data csv_string,
            :type =&gt; 'text/csv; charset=iso-8859-1; header=present',
            :disposition =&gt; "attachment; filename=players_application.csv"
  </code></pre>