Skip to content

table: raise a clear error for a negative width or column width - #2096

Merged
andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:table-negative-width
Nov 2, 2026
Merged

andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:table-negative-width

Conversation

@RavSinghChandan

Copy link
Copy Markdown

table(width=-50), table(col_widths=-30) or a negative value in col_widths such as (-1, 2) failed with an unrelated FPDFException: Not enough horizontal space to render a single character. table() now raises a ValueError naming the invalid width or col_widths, like it already does for a width larger than the page.

  • A unit test is covering the code added / modified by this PR
  • A mention of the change is present in CHANGELOG.md
  • This PR is ready to be merged

@andersonhc
andersonhc merged commit d935a41 into py-pdf:master Nov 2, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants