dompdf Page break if element is exceeding page height?

后端 未结 5 1686
清酒与你
清酒与你 2021-01-30 16:46

What is the best way to do page breaks in dompdf?

I have had a look here at the page-break-before css attribute, but it didn\'t work when I did:

table {p         


        
5条回答
  •  Happy的楠姐
    2021-01-30 17:23

    //Firstly assign a variable before starting for loop and set post-increment operator inside for loop. secondly, use with condition of data display item in a single page.

      
              @foreach ($purchases as $key=> $purchase)
                   
                        {{ $key + 1 }}  
                        {{ $purchase->supplier->company_name ? 
                       $purchase->supplier->company_name : "" }}  
                        {{ "S-".$purchase->id  }}   
                        {{  salte_items($purchase->purchaseItems) }}        
                        {{ $purchase->created_at->format('d-m-Y') }}  
                        {{ intval($purchase->total) }}    
                        
                      
                        @if ( $n % 25 == 0 )
                            
    @endif @endforeach

提交回复
热议问题