Skip to content

table: treat a colspan below 1 as spanning one column - #2058

Merged
andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:table-colspan-below-one
Oct 25, 2026
Merged

andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:table-colspan-below-one

Conversation

@RavSinghChandan

Copy link
Copy Markdown

A table cell with colspan=0 raised ZeroDivisionError when it was alone in its row, and broke the column layout otherwise; colspan=-1 raised FPDFException: Not enough horizontal space to render a single character. A rowspan below 1 already renders exactly like rowspan=1.

A colspan below 1 now spans one column, like rowspan, and like write_html() already treats an invalid HTML colspan. Valid values are unchanged. Added a test comparing colspan=0 and colspan=-1 with colspan=1, in a table with several cells per row and in a single-cell table.

@andersonhc
andersonhc merged commit 5ee537a into py-pdf:master Oct 25, 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