whether PDF generation is generated from the declared class or inside the controller you need to add the following line to your Gemfile
gem 'prawn-table', '~> 0.2.1'
At the time of writing, this is the gem version, this will give you access to table methods like position
I used it in this example and it worked
def table_items(chart_data, doc) table = Prawn::Table.new(table_rows(chart_data), doc, {:header => true}) table.row(0).font_style = :bold table.position = :center table.draw end
source share