【发布时间】:2019-10-01 22:49:58
【问题描述】:
在 PHP 中,我试图设置一个“表格”,但似乎无法沿一行均匀地设置单元格高度:
我想获得一个干净的表格格式,其中“这是我的长...”的行都是相同的单元格高度。但是文档上的唯一功能是GetStringWidth(),所以我不知道如何将其应用于此处的案例。
这是所需的输出:
这是我的代码:
//Custom hard coded widths for the template
$width = array(12, 20, 30, 20, 15, 12, 20, 18, 25, 15, 10);
foreach ($row as $col) {
$y = $this->GetY();
$x = $this->GetX();
$this->MultiCell($width[$i], 3, $col, 1, 'C', FALSE);
$this->SetXY($x + $width[$i], $y);
$i++;
}
编辑:
在做了更多研究之后,我发现这个库不能满足我的需要,它实际上缺少基本库的大部分功能,所以我决定使用tcpdf 作为我的库。
【问题讨论】: