Jump to content

pdf correct alignment of rows


Yohanne

Recommended Posts

Hi coders,

 

help to get correct alignment of the following, below is the output that i need to set column.

 

psc.png

<?php


require('fpdf.php');
include ('config.php');
$pdf=new FPDF(); 
$pdf->Open(); 
$pdf->AddPage();
$pdf->SetFont('Arial','B',10);
$pdf->Cell(40,1,'Hello World!');
	$str = "SELECT * FROM code_number"; 
		$result = mysql_query($str);
			while($row = mysql_fetch_array($result))
				{ 
					$pdf->MultiCell(60,5,$row['code'],50,'L',0,1);
					$pdf->MultiCell(60,5,$row['code_id'],0,'L',0,;
					$pdf->MultiCell(60,5,$row['yy'],40,'L',0,10);
				}
		ob_end_clean();
	$pdf->Output();
?>
Link to comment
https://forums.phpfreaks.com/topic/287076-pdf-correct-alignment-of-rows/
Share on other sites

Your syntax on the multiicell calls is incorrect.  See the manual.  It s/b (w,h,string,border,align,fill).  You have a number preceding the border parm that doesn't belong there.

 

Also - as I discovered with the multicell - you have to reset your y position after a call to it if it puts out more than one line. 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.