Yohanne Posted March 19, 2014 Share Posted March 19, 2014 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(); ?> Link to comment https://forums.phpfreaks.com/topic/287076-pdf-correct-alignment-of-rows/ 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 Link to comment https://forums.phpfreaks.com/topic/287076-pdf-correct-alignment-of-rows/#findComment-1473097 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. Link to comment https://forums.phpfreaks.com/topic/287076-pdf-correct-alignment-of-rows/#findComment-1473115 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.