细胞的 fpdf 对齐
我正在尝试使用 fpdf
生成 PDF,但遇到一个小问题
,我需要 2 个单元格,如下所示:
------------------------- -------------------------
| Address Line 1 | Version |
| Address Line 2 | 1.0 |
| City | 06/05/2011 |
------------------------- -------------------------
我尝试使用 MultiCell()
但没有运气。
$address = '
Address Line 1
Address Line 2
City
Postcode';
$pdf->MultiCell(133.5, 2.7, $address, 'L', 'L');
$version = '
Version
1.0
06/05/2011';
$pdf->MultiCell(53.5, 2.7, $version, 'R', 'R');
我认为我可以将“浮动”设置为向左或向右,这就是文档所说的,但这似乎不起作用。它只是在地址下方列出版本多单元格,而不是在地址右侧。
有谁知道为什么会这样?
谢谢
I'm trying to generate a PDF using fpdf
and I'm having a small problem
I need to have 2 cells, like the following:
------------------------- -------------------------
| Address Line 1 | Version |
| Address Line 2 | 1.0 |
| City | 06/05/2011 |
------------------------- -------------------------
I've tried using MultiCell()
but with no luck.
$address = '
Address Line 1
Address Line 2
City
Postcode';
$pdf->MultiCell(133.5, 2.7, $address, 'L', 'L');
$version = '
Version
1.0
06/05/2011';
$pdf->MultiCell(53.5, 2.7, $version, 'R', 'R');
I thought that I could possibly set the 'float' as it was left or right, which is what the docs say, but this doesn't seem to work. It just lists the Version multicell below the address and not to the right of it.
Does anyone have any idea why this would be?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://www.fpdf.org/en/tutorial/tuto5.htm:
只需使用:
所以这意味着,在“position-next-cell”之后添加一列应该是
0
您正在寻找的可能是:在第二次调用之后,您注意到
1
这意味着下一个单元格被放置在下面而不是后面(0
会这样做。)http://www.fpdf.org/en/tutorial/tuto5.htm:
Just use:
So this means, to add a column afterwards 'position-next-cell' should be
0
what you're looking for is probably:After the 2nd call you noticed the
1
which means a next cell is being placed underneath and not after (which the0
would do.)