the docs say that tables cannot span a page break. You need to close the table before the break, then open a new one.
Mar 29, 2020
10
Level 2
barryvdh/laravel-dompdf table page break problem
Hi,
so I am using barryvdh/laravel-dompdf to generate invoice table, but the problem is on page break.
css:
.page-break {
page-break-before: always;
}
in my blade file:
<tbody>
@foreach($invoice->articles as $article)
<tr>
<td>
{{ $loop->iteration }}
</td>
<td>
{{ $article->name }}
</td>
<td>
{{ $article->quantity }}
</td>
...
</tr>
@if($loop->iteration == 13)
<div class="page-break"></div>
@endif
@endforeach
</tbody>
I am braking table after 13 items, and everything is fine, but the row on item 14 is screwed because of this div I assume:
https://www.dropbox.com/s/aupu3tu4wwx2yel/Screenshot_20200329_115614.png?dl=0
Level 122
Please or to participate in this conversation.