Placing two MultiCells next to each other using FPDF in PHP

前端 未结 3 1121
陌清茗
陌清茗 2021-01-18 12:19

I trying to create a custom table using FPDF Cell/MultiCell.

My 1st cell is a MultiCell that has two lines of text. The next cell should then just be pl

3条回答
  •  清歌不尽
    2021-01-18 13:06

    Before printing your first multicell, record the cursor position:

    $x=$this->GetX();
    $y=$this->GetY();
    

    add your multicell using $this->Multicell($w,5,'Content');

    Reset the cursor position to the start height (y) and the start horizontal + the width of the 1st multicell:

    $this->SetXY($x+$w,$y);
    

    Add your next multicell and repeat as necessary.

提交回复
热议问题