如何使用 PHP 使用 FPDF 制作这样的表格?
我似乎不知道如何用 $this->Cell
来做到这一点。
最佳答案
FPDF 无法识别 rowspan
或 colspan
。这是您可以尝试的解决方法,使用空单元格和 Cell
的 border
属性.
$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);
结果是——
关于php - 如何使用 PHP 使用 FPDF 制作这样的表格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13407085/