我正在尝试在 TCPDF 中创建发票,但无法创建表。表格单元格必须自动换行。我阅读了大量网站如何做到这一点,但我无法做到正确。
\n\n问题出在第二行,我可以让单元格对齐。\n单元格高度有问题 http://apartman-donat.com/Capture.JPG
\n\n这是我的代码:
\n\n$pdf->ln(20);\n$w = array(10, 80, 15, 25,30,35);\n$pdf->SetFillColor(127, 127, 127);\n$pdf->SetTextColor(255,255,255);\n$pdf->SetDrawColor(127, 127, 127);\n$pdf->SetLineWidth(0.3);\n$pdf->SetFont($fontname,\'\',12);\n$pdf->Cell($w[0], 10, \'#\', 1, 0, \'C\', 1);\n$pdf->Cell($w[1], 10, \'OPIS USLUGE\', 1, 0, \'C\', 1);\n$pdf->Cell($w[2], 10, \'J.mj.\', 1, 0, \'C\', 1);\n$pdf->Cell($w[3], 10, \'Koli\xc4\x8dina\', 1, 0, \'C\', 1);\n$pdf->Cell($w[4], 10, \'Cijena\', 1, 0, \'C\', 1);\n$pdf->Cell($w[5], 10, \'Iznos [Kn]\', 1, 0, \'C\', 1);\n$pdf->ln();\n$pdf->SetFillColor(255, 255, 255);\n$pdf->SetTextColor(0,0,0);\n$pdf->SetDrawColor(127, 127, 127);\n$pdf->SetLineWidth(0.3);\n$pdf->SetFont($fontname,\'\',8);\n//$pdf->setFontSpacing(0);\n//$pdf->setCellHeightRatio(0.8);\n//$pdf->MultiCell($w, $h, $txt, $border, $align, $fill, $ln, $x, $y, $stretch, $ishtml, $autopadding, $valign, $fitcell);\n$pdf->MultiCell($w[0], 15, \'1\', 1, \'C\', false, …Run Code Online (Sandbox Code Playgroud)