您如何使用PHP使用FPDF制作这样的表格? [英] How do you make a table like this with FPDF using PHP?

查看:341
本文介绍了您如何使用PHP使用FPDF制作这样的表格?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

How do you make a table like this with FPDF using PHP?

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

I can't seem to figure out how to do this with $this->Cell.

推荐答案

FPDF无法识别rowspancolspan.您可以尝试使用以下变通方法,将空单元格和border属性用于 .

FPDF does not recognize rowspan or colspan. Here is a workaround that you can try, using empty cells and the border attribute for 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);

,结果将是-

这篇关于您如何使用PHP使用FPDF制作这样的表格?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆