Skip to content

Help! How do i make 3 tables across a landscape page #1358

Closed Answered by gettalong
pethl asked this question in Q&A
Discussion options

You must be logged in to vote

Have you tried using a grid?

require 'prawn'
require 'prawn/table'

Prawn::Document.generate('tables.pdf') do·
  define_grid(columns: 3, rows: 1, gutter: 10)
  grid(0, 0).bounding_box do
    table([['a1', 'b'], ['c', 'd']])
  end
  grid(0, 1).bounding_box do
    table([['a2', 'b'], ['c', 'd']])
  end
  grid(0, 2).bounding_box do
    table([['a3', 'b'], ['c', 'd']])
  end
end

Result:

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pethl
Comment options

Answer selected by pethl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants