如何使用 FPD 打印单元格内的单元格


how to print a cell inside a cell using fpdf

我正在使用fpdf库从php代码制作一些pdf文档。在该文档中,我创建了两个这样的单元格

    $pdf->Cell(100,100,"Text inside first column",1,0,'L');
    $pdf->Cell(35,35,'Text inside second column ',1,0,'C');

上面的代码效果很好,输出有两个单元格,第一个大小为 100x100,第二个大小为 35x35,第二个单元格正好与第一个单元格。

但是我需要在第一个单元格内打印第二个销售在 fpdf 中有什么办法吗?谁能帮我?

我不确定你想要什么,但也许这个插件可以帮助你做到这一点:

http://www.interpid.eu/fpdf-table

另一种方法是移动指针,如下所示:

$pdf->Cell(100,100,"Text inside first column",1,0,'L');
$pdf->SetX($pdf->GetX() - 35);
$pdf->Cell(35,35,'Text inside second column ',1,0,'C');

在嵌套单元格 X 轴和 Y 轴中,我实现了这样的成就

`$pdf->Cell(190,20,"",1,0,'L');
$pdf->SetX($pdf->GetX() - 189);
$pdf->Cell(100,10,'First ',2,0,'L');
$pdf->Cell(90,10,'March/2020 ',2,0,'R');
$pdf->SetY($pdf->GetY() +5);
$pdf->Cell(100,10,'MCB,UBl Omni, HBL Konnect, Alfalah , Mobi Cash ',2,0,'L');
$pdf->SetY($pdf->GetY() +5);`enter code here`
$pdf->Cell(139,10,'third text he`enter code here`re ',2,0,'L');
$pdf->Cell(50,10,'Lahore',2,0,'R');`