Skip to content

write_html: stop a rowspan past the last row at the last row, like br… - #2031

Merged
andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:html-rowspan-past-last-row
Oct 15, 2026
Merged

andersonhc merged 1 commit into
py-pdf:masterfrom
RavSinghChandan:html-rowspan-past-last-row

Conversation

@RavSinghChandan

Copy link
Copy Markdown

A <td rowspan="99"> near the end of a table, as written by many HTML generators, made write_html() raise FPDFException: Rowspan extends beyond end of table. The HTML spec says a rowspan that goes past the last row ends at the last row, which is what browsers draw. write_html() now applies that to the cells before rendering. Table itself still raises for programs that build tables directly. Added tests comparing against the equivalent valid rowspan.

@andersonhc andersonhc left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good to merge.

Limitation: The current clamp counts rows through the end of the whole table rather than the containing thead, tbody, or tfoot.

@andersonhc
andersonhc merged commit 6196fc9 into py-pdf:master Oct 15, 2026
30 of 42 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