FPDF - WriteHTML in Multicell?

前端 未结 6 1143
情书的邮戳
情书的邮戳 2021-01-03 13:12

Can WriteHTML placed in Multicell? How?

I retrieved and display the HTML output from database but want to position it in the 2nd column(let\'s say) so I put it in Mu

6条回答
  •  渐次进展
    2021-01-03 13:32

    @Khaled solution works great, if you whould like to preserve left position, try this:

    function WriteHtmlCell($cellWidth, $html){
        $rm = $this->rMargin;
        $lm = $this->lMargin;
        $this->SetRightMargin($this->w - $this->GetX() - $cellWidth);
    
        $this->SetLeftMargin($this->GetX());
    
        $this->WriteHtml($html);
        $this->SetRightMargin($rm);
        $this->SetLeftMargin($lm);
    }
    

提交回复
热议问题