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();
?>
Edited by JaysonDotPH
Link to comment
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. 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.