TCPDF: HTML table and page breaks

后端 未结 8 1350
刺人心
刺人心 2021-01-31 04:04

I am creating a large HTML table and I have problem with page breaks as you can see in the following image:

Is there a method settle down the problem automatically? Or

8条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-01-31 04:33

    roney, thank you so much, writing HTML generated overlaps with the header for pages 2,3 .. this worked for me:

    class your_PDF extends TCPDF
    {
       var $top_margin = 20;
    
       function Header() {
           // set top margin to style pages 2, 3..
           //title goes here
           $this->top_margin = $this->GetY() + 5; // padding for second page
        }
    }
    

    in your code

    // set top margin to style pages 2, 3..
    $pdf->SetMargins(15, $pdf->top_margin, 15); 
    

提交回复
热议问题