php - 如何使用 PHP 使用 FPDF 制作这样的表格?

标签 php pdf-generation tcpdf fpdf

如何使用 PHP 使用 FPDF 制作这样的表格?

我似乎不知道如何用 $this->Cell 来做到这一点。

Table

最佳答案

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

关于php - 如何使用 PHP 使用 FPDF 制作这样的表格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13407085/

相关文章:

javascript - 使用 PHP 在服务器上保存 .toDataURL() 错误 500

php - unoconv 命令作为 apache 运行时出错

php - 使用 jQuery、AJAX、MySQL 的 TreeView

php - 处理接口(interface) fatal error

php - 如何使用 PHP 发送和接收加密的电子邮件

excel - 用于生成 excel ruby​​ 的 gem list pdfkit

tcpdf : prevent page break within a block

php - 如何在 tcpdf 中手动定位条形码

php - TCPDF UTF-8 符号未显示

php - file_put_contents(C :\storage\framework\views/27f511f5644086daa68b2cf835bf49f5148aba43. php): 无法打开流: 没有这样的文件或目录