2012-11-15 8 views

Odpowiedz

14

FPDF nie rozpoznaje rowspan lub colspan. Oto obejście, które można wypróbować za pomocą pustych komórek i atrybutu border dla Cell.

$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); 

a wynik byłby - fpdf table example

+0

komórki funkcja nie owija zawartości komórki, jeśli długość zawartości przekracza szerokość komórki, z której wypływa. Brzydki wpływ, jeśli masz adres i pokazać za pomocą komórki, to ucieknie od strony. czy wiesz, jak to naprawić? mogę być za pomocą MultiCell? –

1

Dzięki, że pomogło, to pracował dla mnie:

$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(); 
Powiązane problemy