-
Notifications
You must be signed in to change notification settings - Fork 689
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
Calculating table width broken when using an array of widths #710
Comments
@hbrandl ping |
I can confirm the bug report. Testcase it "illustrates issue #710", :unresolved, :issue => 710 do
partial_width = 40
pdf = Prawn::Document.new({page_size: "LETTER", page_layout: :portrait})
col_widths = [
50,
partial_width, partial_width, partial_width, partial_width
]
day_header = [{
content: "Monday, August 5th, A.S. XLIX",
colspan: 5,
}]
times = [{
content: "Loc",
colspan: 1,
}, {
content: "8:00",
colspan: 4,
}]
data = [ day_header ] + [ times ]
#raises Prawn::Errors::CannotFit:
#Table's width was set larger than its contents' maximum width (max width 210, requested 218.0)
table = Prawn::Table.new data, pdf, :column_widths => col_widths
end I'll look into it and keep you updated. |
Fixed with pull request 712. @sandal please review and merge The problem was that only column 0 ever existed by itself. Column 1 to 4 where always merged. While I don't see a use case where this may be necessary, I do think that this error is still raised unexpectedly thus I fixed it. |
Thanks @hbrandl. @skandragon Can you try the code on the |
This code does not properly run on 1.0.0, with the error
The text was updated successfully, but these errors were encountered: