单元格未放置在多单元

时间:2016-02-17 10:25:05

标签: php fpdf

我正在使用php中的fpdf创建pdf格式的发票。我的要求是使用评论旁边的multicell(),创建评论框,我想使用cell()显示帐单的总计。但是在输出中,单元显示在多单元的下方,而不是放在多单元的旁边

我的代码是:

$pdf->SetFillColor(204,204,204);        //for filling grey color
$pdf->cell(105,5,'Comments',1,1,'',true);  //header of the comment box
$pdf->MultiCell(105,30,'abcd',1,'');     //content of the comment box
$pdf->cell(5,5,'Grand Total',1,1,'C');   //show grand total of the bill
我清楚了吗?如果没有评论,我会描述。

1 个答案:

答案 0 :(得分:1)

您必须为下一个单元格设置X坐标,如下所示: -

$current_y = $pdf->GetY();
$current_x = $pdf->GetX();
$pdf->MultiCell(105,5,'value',1,'T', false,'T');
$pdf->SetXY($current_x + 100, $current_y);
<next-cell>

你在MultiCell之后获得了下一个单元格。希望它对你有用......

相关问题