I have a dynamic table in my web page that sometimes contains lots of rows. I made the page-break after 22 rows. i need to repeat certain table (info table, see image) in a new page. how do i do that?
image https://i.ibb.co/LN8gVbD/Screen-Shot-2019-05-26-at-03-34-26.png
the other thing, I'm unable to get the page-break in Chrome. it's only working in Firefox, how to fix that in Chrome?
<style type="text/css">
#receipt-data { font-size: 12px; }
@media print {
tr.page-break{
page-break-inside: avoid;;
page-break-before:always;
}
@page {
size:portrait;
}
}
</style>
<div id="receipt-data">
<table class="table hed">
<thead style="text-align:center;">
<tr style="text-align:center;">
<th colspan="1">Name</th>
<th colspan="2">{{$customer_data->name}}i</th>
<th colspan="1">Customer Tax No</th>
<th colspan="2">{{$customer_data->tax_no}}</th>
</tr>
</thead>
</table>
<table class="table table-bordered" style="text-align:center;">
<thead>
<tr>
<th>S</th>
<th>Item Code</th>
<th>Description</th>
<th>Unit</th>
<th>Unit Price</th>
<th>Qty</th>
<th>Amount($)
</th>
</tr>
</thead>
<tbody>
@foreach($product_sale_data as $key=>$product_sale_data)
@php
$product_data = \App\Product::find($product_sale_data->product_id);
if($product_data->sale_unit_id)
$unit = \App\Unit::find($product_data->sale_unit_id)->unit_name;
else
$unit = 'N/A';
@endphp
<tr class = @if ( $key % 22 == 0 && $key ) "page-break" @endif>
<td>{{$key+1}}</td>
<td>{{$product_data->code}}</td>
<td>{{$product_data->name}}</td>
<td>{{$unit}}</td>
<td>{{number_format($product_sale_data->total / $product_sale_data->qty, 2)}}</td>
<td>{{$product_sale_data->qty}}</td>
<td>{{number_format($product_sale_data->total, 2)}}</td>
@endforeach
<br>