Yohanne Posted March 19, 2014 Share Posted March 19, 2014 (edited) Hi coders, help to get correct alignment of the following, below is the output that i need to set column. <?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 March 19, 2014 by JaysonDotPH Quote Link to comment Share on other sites More sharing options...
cyberRobot Posted March 19, 2014 Share Posted March 19, 2014 Are you trying to create a table? If so, perhaps the table tutorial from FPDF's website will help: http://www.fpdf.org/en/tutorial/tuto5.htm Quote Link to comment Share on other sites More sharing options...
ginerjm Posted March 19, 2014 Share Posted March 19, 2014 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.