Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to center table in prawn?

I have created a table in prawn and wanted to pass the :position option by whih is also documented in the manual but it throws off an Method_missing error. It seems like this parameter doesnt exist anymore. How can I center a table in prawn?

like image 749
davidb Avatar asked Mar 08 '12 14:03

davidb


2 Answers

I ran into the same error. Installing from master on Github fixed the issue.

# Gemfile
gem 'prawn', git: 'https://github.com/prawnpdf/prawn.git'

Issue thread on Github

like image 187
David Tuite Avatar answered Oct 21 '22 15:10

David Tuite


Hope this helps

pdf.table tablename,
    :border_width => 0,
    :font_size => 11,
    :position => :center
like image 24
bharath Avatar answered Oct 21 '22 15:10

bharath