I am trying to create invoice in TCPDF, but I cant create table. Table cells must have Word Wrapping. I readed tons of site how to do that but I cant get it right.
Problem is with second row, I can get cells line up. Cell height isproblem http://apartman-donat.com/Capture.JPG
Here is my code:
$pdf->ln(20);
$w = array(10, 80, 15, 25,30,35);
$pdf->SetFillColor(127, 127, 127);
$pdf->SetTextColor(255,255,255);
$pdf->SetDrawColor(127, 127, 127);
$pdf->SetLineWidth(0.3);
$pdf->SetFont($fontname,'',12);
$pdf->Cell($w[0], 10, '#', 1, 0, 'C', 1);
$pdf->Cell($w[1], 10, 'OPIS USLUGE', 1, 0, 'C', 1);
$pdf->Cell($w[2], 10, 'J.mj.', 1, 0, 'C', 1);
$pdf->Cell($w[3], 10, 'Količina', 1, 0, 'C', 1);
$pdf->Cell($w[4], 10, 'Cijena', 1, 0, 'C', 1);
$pdf->Cell($w[5], 10, 'Iznos [Kn]', 1, 0, 'C', 1);
$pdf->ln();
$pdf->SetFillColor(255, 255, 255);
$pdf->SetTextColor(0,0,0);
$pdf->SetDrawColor(127, 127, 127);
$pdf->SetLineWidth(0.3);
$pdf->SetFont($fontname,'',8);
//$pdf->setFontSpacing(0);
//$pdf->setCellHeightRatio(0.8);
//$pdf->MultiCell($w, $h, $txt, $border, $align, $fill, $ln, $x, $y, $stretch, $ishtml, $autopadding, $valign, $fitcell);
$pdf->MultiCell($w[0], 15, '1', 1, 'C', false, 0, '', '', false, 0, false, false, 15,'T', false);
$pdf->MultiCell($w[1], 15, 'Energetski pregled i izrada energetskog certifikata stana na adresi: Petrova ul. 33, 10000 Zagreb', 1, 'L', false, 0, '', '', false, 0, false, false, 0,'T', false);
$pdf->MultiCell($w[2], 15, 'kom', 1, 'C', false, 0, '', '', false, 0, false, false, 15,'B', false);
$pdf->MultiCell($w[3], 15, '1', 1, 'C', false, 0, '', '', false, 0, false, false, 15,'B', false);
$pdf->MultiCell($w[4], 15, '600.00', 1, 'C', false, 0, '', '', false, 0, false, false, 15,'B', false);
$pdf->MultiCell($w[5], 15, '600.00', 1, 'C', false, 0, '', '', false, 0, false, false, 15,'B', false);
What am I doing wrong?