Level 63
That's not directly the answer to your question, but why don't you export your data with the Laravel-Excel package ?
https://docs.laravel-excel.com/3.1/exports/export-formats.html
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I used mpdf in Laravel to create an invoice with an HTML table that has a header and footer.
The table breaks automatically when it reaches the footer, but the border at the bottom of the last row is missing like in the image below:

How can I add the border at the bottom of the last row on each page? Also, I need to extend the height of the last row to the start of the footer on each page.
Please or to participate in this conversation.