如何调整阵列 FPDF 中的多单元
我需要帮助,了解如何使数组内的数据在多单元格中处于同一高度且高度相同,
这是代码:
$colored = false;
foreach($products_info as $row){
if($colored){
$this->SetFillColor(218,218,218);
}else{
$this->SetFillColor(255,255,255);
}
$this->Cell(40,15,ucwords($row["libelle"]),1,0,'L',$colored);
$this->MultiCell(40,15,ucwords($row["description"]),1,1,'L',$colored);
$this->Cell(40,15,number_format($row["prix_unitaire"],3,","," "),1,0,"C",$colored);
$this->Cell(20,15,number_format($row["quantity"],3,","," "),1,0,"C",$colored);
$this->Cell(10,15,number_format($row["largeur"],3,","," "),1,0,"C",$colored);
$this->Cell(10,15,number_format($row["hauteur"],3,","," "),1,0,"C",$colored);
$this->Cell(30,15,number_format($row["total_ht"],3,","," "),1,1,"R",$colored);
$colored = !$colored;
}
这是代码:
$colored = false;
foreach($products_info as $row){
if($colored){
$this->SetFillColor(218,218,218);
}else{
$this->SetFillColor(255,255,255);
}
$this->Cell(40,15,ucwords($row["libelle"]),1,0,'L',$colored);
$this->Cell(40,15,ucwords($row["description"]),1,0,'L',$colored);
$this->Cell(40,15,number_format($row["prix_unitaire"],3,","," "),1,0,"C",$colored);
$this->Cell(20,15,number_format($row["quantity"],3,","," "),1,0,"C",$colored);
$this->Cell(10,15,number_format($row["largeur"],3,","," "),1,0,"C",$colored);
$this->Cell(10,15,number_format($row["hauteur"],3,","," "),1,0,"C",$colored);
$this->Cell(30,15,number_format($row["total_ht"],3,","," "),1,1,"R",$colored);
$colored = !$colored;
}
i need a help on how to make the data inside the array to be in one ligne and same height in multicell
and this is the code :
$colored = false;
foreach($products_info as $row){
if($colored){
$this->SetFillColor(218,218,218);
}else{
$this->SetFillColor(255,255,255);
}
$this->Cell(40,15,ucwords($row["libelle"]),1,0,'L',$colored);
$this->MultiCell(40,15,ucwords($row["description"]),1,1,'L',$colored);
$this->Cell(40,15,number_format($row["prix_unitaire"],3,","," "),1,0,"C",$colored);
$this->Cell(20,15,number_format($row["quantity"],3,","," "),1,0,"C",$colored);
$this->Cell(10,15,number_format($row["largeur"],3,","," "),1,0,"C",$colored);
$this->Cell(10,15,number_format($row["hauteur"],3,","," "),1,0,"C",$colored);
$this->Cell(30,15,number_format($row["total_ht"],3,","," "),1,1,"R",$colored);
$colored = !$colored;
}
this is the old version before i add multicell
and this is the code :
$colored = false;
foreach($products_info as $row){
if($colored){
$this->SetFillColor(218,218,218);
}else{
$this->SetFillColor(255,255,255);
}
$this->Cell(40,15,ucwords($row["libelle"]),1,0,'L',$colored);
$this->Cell(40,15,ucwords($row["description"]),1,0,'L',$colored);
$this->Cell(40,15,number_format($row["prix_unitaire"],3,","," "),1,0,"C",$colored);
$this->Cell(20,15,number_format($row["quantity"],3,","," "),1,0,"C",$colored);
$this->Cell(10,15,number_format($row["largeur"],3,","," "),1,0,"C",$colored);
$this->Cell(10,15,number_format($row["hauteur"],3,","," "),1,0,"C",$colored);
$this->Cell(30,15,number_format($row["total_ht"],3,","," "),1,1,"R",$colored);
$colored = !$colored;
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在github中找到了一个解决方案 在此处输入链接描述
我用这些函数
,这是我经过一些更改后的代码:
i found a solution in github enter link description here
i use these functions
and here is my code after some changes :