2012-11-15 26 views

回答

14

FPDF不承认rowspancolspan。您可以尝试下面的解决方法,使用空单元格和Cellborder属性。

$pdf->Cell(40,5,' ','LTR',0,'L',0); // empty cell with left,top, and right borders 
$pdf->Cell(50,5,'Words Here',1,0,'L',0); 
$pdf->Cell(50,5,'Words Here',1,0,'L',0); 
$pdf->Cell(40,5,'Words Here','LR',1,'C',0); // cell with left and right borders 
$pdf->Cell(50,5,'[ x ] abc',1,0,'L',0); 
$pdf->Cell(50,5,'[ x ] checkbox1',1,0,'L',0); 
$pdf->Cell(40,5,'','LBR',1,'L',0); // empty cell with left,bottom, and right borders 
$pdf->Cell(50,5,'[ x ] def',1,0,'L',0); 
$pdf->Cell(50,5,'[ x ] checkbox2',1,0,'L',0); 

,其结果将是 - fpdf table example

+0

细胞进行函数不包装单元格的内容,如果内容长度超过单元格流动的宽度。丑陋的影响,如果你有地址,并显示使用单元格,那么它将离开页面。你知道如何解决这个问题吗?我可以通过使用MultiCell? –

1

谢谢,这帮助了,这个工作对我来说:

$this->Cell(40,5,' ','LTR',0,'L',0); // empty cell with left,top, and right borders 
$this->Cell(50,5,'111 Here',1,0,'L',0); 
$this->Cell(50,5,'222 Here',1,0,'L',0); 

       $this->Ln(); 

$this->Cell(40,5,'Solid Here','LR',0,'C',0); // cell with left and right borders 
$this->Cell(50,5,'[ o ] che1','LR',0,'L',0); 
$this->Cell(50,5,'[ x ] che2','LR',0,'L',0); 

       $this->Ln(); 

$this->Cell(40,5,'','LBR',0,'L',0); // empty cell with left,bottom, and right borders 
$this->Cell(50,5,'[ x ] def3','LRB',0,'L',0); 
$this->Cell(50,5,'[ o ] def4','LRB',0,'L',0); 

       $this->Ln(); 
       $this->Ln(); 
       $this->Ln();