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

* Skip drawing the table cells if they contain only the header. #717

Merged
merged 1 commit into from
Apr 28, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 3 additions & 1 deletion lib/prawn/table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,9 @@ def draw
c = Cells.new(cells_this_page.map { |ci, _| ci })
@before_rendering_page.call(c)
end
Cell.draw_cells(cells_this_page)
if @header_row.nil? || cells_this_page.size > @header_row.size
Cell.draw_cells(cells_this_page)
end
cells_this_page = []

# start a new page or column
Expand Down
2 changes: 1 addition & 1 deletion spec/table_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@
end

it 'should only draw first-page header if the first multi-row fits',
:unresolved, :issue => 707 do
:issue => 707 do
pdf = Prawn::Document.new

pdf.y = 100 # not enough room for the header and multirow cell
Expand Down