Php 多小区对准

Php 多小区对准,php,fpdf,Php,Fpdf,我在将多小区与fPDF对齐时遇到问题。第三列应该在第二列的旁边 foreach ($order_items as $item_id => $item) { $item_data = $item->get_data(); $pdf->Cell(35, 5, get_post_meta($item_data['product_id'], 'bdsc_ean_code', true), 1, 0); $line_heig

我在将多小区与fPDF对齐时遇到问题。第三列应该在第二列的旁边

    foreach ($order_items as $item_id => $item) {

        $item_data = $item->get_data();

        $pdf->Cell(35, 5, get_post_meta($item_data['product_id'], 'bdsc_ean_code', true), 1, 0);


        $line_height = 2;
        $width = 60;
        $text = ("fjkbdshjbfbdsjhfbjesfbqwfbjqwefbhwfbhjwebjhfjhqwfbhqwefjbwfhbqwhjfbqwjfjfwqwfbjhefhbq");
        $height = (ceil(($pdf->GetStringWidth($text) / $width)) * $line_height);

        $pdf->Multicell($width,$height,$text,1,0);

        $pdf->Cell(40, 5, '', 1, 0);
        $pdf->Cell(20, 5, $item_data['quantity'], 1, 0);

        $pdf->Cell(34, 5, number_format(round($item_data['total'] + $item_data['subtotal_tax'], 2), 2), 1, 1, 'R');//end of line
    }

也许这个例子能帮你找到正确的轨道

$pdf->Cell(40,5,,'LTR',0,'L',0);//具有左、上、右边框的空单元格
$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);//具有左右边框的单元格
$pdf->Cell(50,5,[x]abc',1,0,'L',0);
$pdf->单元格(50,5,[x]复选框1',1,0,'L',0);
$pdf->Cell(40,5,,'LBR',1,'L',0);//具有左、下和右边框的空单元格
$pdf->Cell(50,5,[x]def',1,0,'L',0);
$pdf->单元格(50,5,[x]复选框2',1,0,'L',0);

Hey Mads Sander,它必须是一个多小区,而不是一个nornal小区,但在尝试之前感谢您的帮助。啊,我明白了,让我看看:)将两个多小区相邻对齐:已经尝试过的堆栈溢出问题。但是没有人解决我的问题,请回答您的问题,并包括您用于创建fPDF实例的代码。根据您在上面发布的内容,单元格的宽度将至少为189个单位,很有可能您的fPDF实例的宽度不足以容纳该大小(当您包括边距等时)。