Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow_header_for_the_table #75

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions lib/prawn/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 = true
options.each { |k, v| send("#{k}=", v) }

if block
Expand Down Expand Up @@ -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
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just remove the line. Leaving dead code as comments pollutes the file, and one can always look in the commit history to see the "blame"

move_past_bottom
# we are at the top of a new page
0
end
Expand Down Expand Up @@ -695,6 +695,10 @@ def with_position
@pdf.y = final_y
end

def move_past_bottom
@pdf.start_new_page(:top_margin => 120, :bottom_margin => 90)
end

end
end

Expand Down