I'm using TCPDF to render list of products and their available SKUs.
As the attached image below:
- "Product name" (P1) will be displayed in a row.
- "N of SKUs" (P2) will be displayed in N row.
Using attribute nobr="true"
for td
tag, I can avoid a row split into separated page. However, it makes P1 and rows of P2 break page in some cases.
Code example (Laravel blade):
<tr nobr="true">
<td>{{ $product->name }}</td>
<td>{{ $otherInfo }}</td>
</tr>
@foreach ($product->skus as $sku)
<tr nobr="true">
<td>{{ $sku->number }}</td>
<td>{{ $sku->quantity }}</td>
</tr>
@endforeach
I would like to make the block of P1 and P2 same page. If the block's height exceeded bottom margin, they should be moved to next page.
Do you guys have any solutions or keywords to solve this problem?
Many thanks for your help!