Creating Basic Table in FPDF Tamil


Tables

Create a small mark display table using fpdf

Source Code

<?php
    require_once "fpdf/fpdf.php"; //fpdf supporting file
 
    $pdf = new FPDF('P','mm','A4');
    /*
        A4 - 210 * 297 mm
 
    */
    $pdf -> AddPage();
 
    //addFont(family,style,file)
    $pdf -> addFont('Roboto','','Roboto.php'); 
    $pdf -> SetFont('Roboto','',12);
 
 
    $pdf -> Cell(190,10,'Basic Table',0,1,'C',false);
    $pdf -> Cell(190,3,'',0,1,'C',false);
    $pdf -> Cell(190,10,'Tutor Joes Computer Education',1,1,'C',false);
 
    //  Column Titles
    $pdf -> Cell(38,7,'SNO',1,0,'C',false);
    $pdf -> Cell(38,7,'NAME',1,0,'C',false);
    $pdf -> Cell(38,7,'MARK 1',1,0,'C',false);
    $pdf -> Cell(38,7,'MARK 2',1,0,'C',false);
    $pdf -> Cell(38,7,'MARK 3',1,1,'C',false);
 
    //  Row Datas
    $pdf -> Cell(38,7,'1',1,0,'C');
    $pdf -> Cell(38,7,'Ram',1,0,'');
    $pdf -> Cell(38,7,'98',1,0,'C');
    $pdf -> Cell(38,7,'97',1,0,'C');
    $pdf -> Cell(38,7,'91',1,1,'C');
 
    $pdf -> Cell(38,7,'2',1,0,'C');
    $pdf -> Cell(38,7,'Sam',1,0,'');
    $pdf -> Cell(38,7,'96',1,0,'C');
    $pdf -> Cell(38,7,'24',1,0,'C');
    $pdf -> Cell(38,7,'38',1,1,'C');
 
    $pdf -> Cell(38,7,'3',1,0,'C');
    $pdf -> Cell(38,7,'Mithran',1,0,'');
    $pdf -> Cell(38,7,'95',1,0,'C');
    $pdf -> Cell(38,7,'87',1,0,'C');
    $pdf -> Cell(38,7,'77',1,1,'C');
 
    $pdf -> Cell(38,7,'4',1,0,'C');
    $pdf -> Cell(38,7,'Mithwin',1,0,'');
    $pdf -> Cell(38,7,'97',1,0,'C');
    $pdf -> Cell(38,7,'95',1,0,'C');
    $pdf -> Cell(38,7,'93',1,1,'C');
 
    $pdf -> Cell(38,7,'5',1,0,'C');
    $pdf -> Cell(38,7,'Kaarnika',1,0,'');
    $pdf -> Cell(38,7,'96',1,0,'C');
    $pdf -> Cell(38,7,'85',1,0,'C');
    $pdf -> Cell(38,7,'74',1,1,'C');
 
 
 
 
   $pdf -> Output(); // Display output
?>
View Demo