diff --git a/.gitignore b/.gitignore index ceb10c7..fca087c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ Gemfile.lock manual.pdf +.idea/ \ No newline at end of file diff --git a/lib/prawn/table.rb b/lib/prawn/table.rb index 264bf7a..9ebf4a7 100644 --- a/lib/prawn/table.rb +++ b/lib/prawn/table.rb @@ -137,7 +137,7 @@ def make_table(data, options={}, &block) def initialize(data, document, options={}, &block) @pdf = document @cells = make_cells(data) - @header = false + @header = options[:header].present? ? options[:header] : true options.each { |k, v| send("#{k}=", v) } if block @@ -433,7 +433,7 @@ def ink_and_draw_cells_and_start_new_page(cells_this_page, cell) ink_and_draw_cells(cells_this_page, draw_cells) # start a new page or column - @pdf.bounds.move_past_bottom + move_past_bottom offset = (@pdf.y - cell.y) @@ -479,8 +479,8 @@ def initial_row_on_initial_page # If there isn't enough room left on the page to fit the first data row # (including the header), start the table on the next page. - @pdf.bounds.move_past_bottom - + #@pdf.bounds.move_past_bottom + move_past_bottom # we are at the top of a new page 0 end @@ -695,6 +695,10 @@ def with_position @pdf.y = final_y end + def move_past_bottom + @pdf.start_new_page(:top_margin => 135, :bottom_margin => 90) + end + end end diff --git a/lib/prawn/table/version.rb b/lib/prawn/table/version.rb index 40ee275..16483e6 100644 --- a/lib/prawn/table/version.rb +++ b/lib/prawn/table/version.rb @@ -1,5 +1,5 @@ module Prawn class Table - VERSION = '0.2.3'.freeze + VERSION = '0.2.3' end end