title: Setting cell/column widths on a Prawn table
body: <p>I'm making a little script with ruby which produces a week schedule PDF file, using Prawn as a PDF library and I'm struggling with styling the table. I'd like to set a static width for all the columns in the table so that the widths wouldn't depend on the contents of the cells.</p>
  
  <p>I've read the documentation (lot of room for improvement there) from the Prawn project site and googled for a few hours, but I'm lost at how to set width for columns or cells in a table, or how to style the columns/cells in any way whatsoever. I do get a PDF file which has a grid layout though, the cells just vary in size a lot, which doesn't look that neat.</p>
  
  <p>This didn't work:</p>
  
  <pre><code>Prawn::Document.generate(@filename, :page_size =&gt; 'A4', :page_layout =&gt; :landscape) do
    table(course_matrix, :headers =&gt; HEADERS, :border_style =&gt; :grid, :row_colors =&gt; ['dddddd', 'eeeeee'], :column_widths =&gt; 50)
  end
  </code></pre>
  
  <p>Here's the current version of my method to generate PDF, but it doesn't stylize the cells either:</p>
  
  <pre><code>def produce_pdf
    course_matrix = DataParser.new.parse_for_pdf
  
    Prawn::Document.generate(@filename, :page_size =&gt; 'A4', :page_layout =&gt; :landscape) do
      table(course_matrix, :headers =&gt; HEADERS, :border_style =&gt; :grid, :row_colors =&gt; ['dddddd', 'eeeeee']) do |table|
        table.cells.style { |cell| cell.width = 50 }
      end
    end
  end
  </code></pre>