Kanak Vaghela
Kanak Vaghela

Reputation: 8358

Multi-page tables in html2fpdf

I am facing problem of page break in HTML.

I have static as well dynamic data for creating PDF using html2fpdf script. When I have more than 25 rows in table then page gets break and messed up.

How will I put page break in my HTML or PHP code so html2fpdf script take consider it as page break?

Upvotes: 2

Views: 1677

Answers (1)

user769889
user769889

Reputation: 376

html2pdf will break - it the single content goes beyond specified page type ( default A4 ) .. I have checked with only e.g. content with 50 lines including recursive tables etc

what you can do is restructure your html code in a way that not a single which holds actual content - does not hold bigger content...

e.g.

<table><tr><td>content for header</td></tr></table>
<table><tr><td>content for part 1</td></tr></table>

<table><tr>
<td>first line of content</td>
--- you can have as many lines here but content of single line should not be more than A4 size
<td>1000th line of content</td>
</tr></table>

--- Hope this helps

Upvotes: 1

Related Questions