title: How to add space or tab on fpdf - PHP? [ Function cell() on fpdf can't work ]
body: <p>Do you know how to add a space or tab on fpdf? I used table and change cell function but still not working. </p>
  
  <p>I want to add "keperluan" besides "jakarta" like in the picture below.</p>
  
  <p><img src="https://i.stack.imgur.com/jNvyw.jpg" alt="enter image description here"></p>
  
  <p>And here is the source code :</p>
  
  <pre><code>&lt;?php
  
  require('../fpdf17/fpdf.php');
  require('../koneksi.php');
  
  
  class PDF extends FPDF
  {
  
  function LoadDataFromSQL($sql)
  {
      $hasil=mysql_query($sql) or die(mysql_error());
  
      $data = array();
      while($rows=mysql_fetch_array($hasil)){
          $data[] = $rows;
  
  }
      return $data;
  }
  
  
  // Colored table
  function FancyTable($header, $data)
  {
      // Colors, line width and bold font
      $this-&gt;SetFillColor(255,255,255);
      $this-&gt;SetTextColor(0);
      $this-&gt;SetDrawColor(0,0,0);
      $this-&gt;SetLineWidth(.3);
      $this-&gt;SetFont('','B');
  
      // Header
      $w = array(65,65,30,30);
      for($i=0;$i&lt;count($header);$i++)
          $this-&gt;Cell($w[$i],7,$header[$i],0,0,'C',true);
  
      $this-&gt;Ln();
      // Color and font restoration
      $this-&gt;SetFillColor(224,235,255);
      $this-&gt;SetTextColor(0);
      $this-&gt;SetFont('');
      // Data
      $fill = false;
  
  
  
      foreach($data as $row)
      {
          /* $this-&gt;Cell($w[0],6,'1. Uang Harian Pegawai','LR',0,'L',$fill);
          $this-&gt;Cell($w[1],6,$row[uangharian],'LR',0,'L',$fill);
          $this-&gt;Cell($w[2],6,$row[totaluangharian],'LR',0,'L',$fill);
          $this-&gt;Cell($w[3],6,' ','LR',0,'C',$fill);
          $this-&gt;Ln();
          $this-&gt;Cell($w[0],6,'2. Uang Tunjangan PDLN','LR',0,'L',$fill);
          $this-&gt;Cell($w[1],6,$row[tunjangan],'LR',0,'L',$fill);
          $this-&gt;Cell($w[2],6,$row[totatunjangan],'LR',0,'L',$fill);
          $this-&gt;Cell($w[3],6,' ','LR',0,'C',$fill);
          $this-&gt;Ln();
          $this-&gt;Cell($w[0],6,'3. Uang Taksi Bandara LN Pegawai','LR',0,'L',$fill);
          $this-&gt;Cell($w[1],6,$row[taksiln],'LR',0,'L',$fill);
          $this-&gt;Cell($w[2],6,$row[totaltaksiln],'LR',0,'L',$fill);
          $this-&gt;Cell($w[3],6,' ','LR',0,'C',$fill);
          $this-&gt;Ln();
          $this-&gt;Cell($w[0],6,'','LR',0,'C',$fill);
          $this-&gt;Cell($w[1],6,'Sub Total USD','LR',0,'R',$fill);
          $this-&gt;Cell($w[2],6,$row[totalusd],'LR',0,'L',$fill);
          $this-&gt;Cell($w[3],6,' ','LR',0,'C',$fill);
          $this-&gt;Ln();
  
          $this-&gt;Cell($w[0],6,'5. Uang Taksi Bandara DN','LR',0,'L',$fill);
          $this-&gt;Cell($w[1],6,$row[taksidn],'LR',0,'L',$fill);
          $this-&gt;Cell($w[2],6,'','LR',0,'C',$fill);
          $this-&gt;Cell($w[3],6,$row[totaltaksidn],'LR',0,'L',$fill);
          $this-&gt;Ln();
          $this-&gt;Cell($w[0],6,'','LR',0,'L',$fill);
          $this-&gt;Cell($w[1],6,'Sub Total Rupiah','LR',0,'R',$fill);
          $this-&gt;Cell($w[2],6,'','LR',0,'C',$fill);
          $this-&gt;Cell($w[3],6,$row[totalrupiah],'LR',0,'L',$fill);
          $this-&gt;Ln();
          $this-&gt;Cell($w[0],6,'4. Airport Tax Pegawai','LR',0,'L',$fill);
          $this-&gt;Cell($w[1],6,$row[airporttax].' Rupiah','LR',0,'L',$fill);
          $this-&gt;Cell($w[2],6,'','LR',0,'C',$fill);
          $this-&gt;Cell($w[3],6,$row[airporttax].' Rupiah' ,'LR',0,'L',$fill);
          $this-&gt;Ln();
          $fill = !$fill; */
  
      }
      // Closing line
      $this-&gt;Cell(array_sum($w),0,'','T');
  }
  function FancyTables($headers, $data)
  {
      // Colors, line width and bold font
      $this-&gt;SetFillColor(255,255,255);
      $this-&gt;SetTextColor(0);
      $this-&gt;SetDrawColor(255,255,255);
      $this-&gt;SetLineWidth(.3);
      $this-&gt;SetFont('','',11);
  
      // Header
      $w = array( 35,40,40,40, 35);
  
      for($i=0;$i&lt;count($headers);$i++)
          $this-&gt;Cell($w[$i],7,$headers[$i],1,0,'C',true);
      $this-&gt;Ln();
      // Color and font restoration
      $this-&gt;SetFillColor(0,0,0);
      $this-&gt;SetTextColor(0);
      $this-&gt;SetFont('','',7);
      // Data
      $fill = false;
  
      foreach($data as $row)
      {
          $this-&gt;Cell($w[0],6,'','LR',0,'C');
          $this-&gt;Cell($w[1],6,'    ','LR',0,'C');
          $this-&gt;Cell($w[2],6,'    ','LR',0,'C');
          $this-&gt;Cell($w[3],6,'    ','LR',0,'C');
          $this-&gt;Cell($w[4],6,'    ','LR',0,'C');
          $this-&gt;Ln();
          $this-&gt;Ln();
          $this-&gt;Ln();
          $this-&gt;Cell($w[0],6,'______________________','LR',0,'C',$fill);
          $this-&gt;Cell($w[1],6,'_________________________','LR',0,'C',$fill);
          $this-&gt;Cell($w[2],6,'_________________________','LR',0,'C',$fill);
          $this-&gt;Cell($w[3],6,'_________________________','LR',0,'C',$fill);
          $this-&gt;Cell($w[4],6,'______________________','LR',0,'C',$fill);
          $this-&gt;Ln();
          $this-&gt;Cell($w[0],6,$row['pegawai_EmployeeName'],'LR',0,'C',$fill);
          $this-&gt;Cell($w[1],6,'    ','LR',0,'C',$fill);
          $this-&gt;Cell($w[2],6,'    ','LR',0,'C',$fill);
          $this-&gt;Cell($w[3],6,'    ','LR',0,'C',$fill);
          $this-&gt;Cell($w[4],6,'    ','LR',0,'C',$fill);
          $this-&gt;Ln();
          $fill = !$fill;
  
      }
      // Closing line
      $this-&gt;Cell(array_sum($w),0,'','T');
  }
  }
  
  
  
  
  
  $pdf = new PDF();
  // Column headings
  $pdf-&gt;addPage();
  $pdf-&gt;setAutoPageBreak(true);
  
  $pdf-&gt;setFont('Times','B',14);
  $pdf-&gt;text(50,8,'FORMULIR PERMINTAAN KENDARAAN');
  
  $pdf-&gt;setFont('Times','B',6);
  $pdf-&gt;FancyTable($header,$data);
  
  
  
  $pdf-&gt;Ln(50);
  
  
  $headers = array('Pemohon,', 'KaDept. Pemohon,','KaBag Transport,', 'KaDept Transport,','Pool,');
  
  $id=$_GET['id'];
  $nip = $_GET['nip'];
  
  $sql=mysql_query("SELECT * FROM formulir where RequestNumber = '$id' ") or die(mysql_error());
  $data=mysql_fetch_array($sql);
  
      $tanggalberangkat = $data['tglberangkat'];
          $berangkat = date('d F Y', strtotime($tanggalberangkat));
  
          $tanggalpulang = $data['tglpulang'];
          $pulang = date('d F Y', strtotime($tanggalpulang));
  
  
  
  $query3 = "SELECT * FROM formulir where RequestNumber = '$id'";   
          $rowSet3 = mysql_query($query3);
          $row3 = mysql_fetch_array($rowSet3);
  
  
  
  $pdf-&gt;setFont('Times','B',11);
  
  $pdf-&gt;Cell(6,10,'Request Number',0,0,'L');
  $pdf-&gt;setFont('Times','',11);
  $pdf-&gt;Cell(6,10,'                                  : '.$data['RequestNumber'],0,1, 'L');
  
  
  
  $pdf-&gt;setFont('Times','B',11);
  $pdf-&gt;Cell(6,0.5,'Employee',0,0,'L');
  $pdf-&gt;setFont('Times','',11);
  $pdf-&gt;Cell(6,0.5,'                                  : '.$data['pegawai_EmployeeName'],0,1, 'L');
  
  $pdf-&gt;setFont('Times','B',11);
  $pdf-&gt;Cell(6,10,'NIK',0,0,'L');
  $pdf-&gt;setFont('Times','',11);
  $pdf-&gt;Cell(6,10,'                                  : '.$data['pegawai_EmployeeID'],0,1, 'L');
  
  $pdf-&gt;setFont('Times','B',11);
  $pdf-&gt;Cell(6,0.5,'Bagian',0,0,'L');
  $pdf-&gt;setFont('Times','',11);
  $pdf-&gt;Cell(6,0.5,'                                  : '.$data['jabatan'],0,1, 'L');
  
  $pdf-&gt;setFont('Times','B',11);
  $pdf-&gt;Cell(6,10,'Departemen',0,0,'L');
  $pdf-&gt;setFont('Times','',11);
  $pdf-&gt;Cell(6,10,'                                  : '.$data['Departemen'],0,1, 'L');
  
  $pdf-&gt;setFont('Times','B',11);
  $pdf-&gt;Cell(6,0.5,'Dipergunakan',0,0);
  $pdf-&gt;setFont('Times','',11);
  $pdf-&gt;Cell(6,0.5,'                                  : '.$berangkat,0,0);
  $pdf-&gt;Cell(6,0.5,'                                                       Pukul : '.$data['jamkeberangkatan'],0,1,'L');
  
  $pdf-&gt;setFont('Times','B',11);
  $pdf-&gt;Cell(6,10,'Jenis Kendaraan',0,0,'L');
  $pdf-&gt;setFont('Times','',11);
  $pdf-&gt;Cell(6,10,'                                  : '.$data['tujuan'],0,1, 'L');
  
  $pdf-&gt;setFont('Times','B',11);
  $pdf-&gt;Cell(6,0.5,'Tujuan',0,0,'L');
  $pdf-&gt;setFont('Times','',11);
  $pdf-&gt;Cell(6,0.5,'                                  : '.$data['tujuan'],0,1, 'L');
  
  $pdf-&gt;setFont('Times','B',11);
  $pdf-&gt;Cell(6,10,'Keperluan',0,0,'L');
  $pdf-&gt;setFont('Times','',11);
  $pdf-&gt;Cell(6,10,'                                  : '.$data['keperluan'],0,1, 'L');
  
  $pdf-&gt;setFont('Times','B',11);
  $pdf-&gt;Cell(6,0.5,'Catatan',0,0,'L');
  $pdf-&gt;setFont('Times','',11);
  $pdf-&gt;Cell(6,0.5,'                                  : '.$data['catatan'],0,1, 'L');
  
  
  
  $query  = "SELECT * FROM formulir where RequestNumber = '$id' ";                
  
  $data = $pdf-&gt;LoadDataFromSQL($query);
  $pdf-&gt;Ln(20); 
  $pdf-&gt;SetFont('Times','',12);
  $pdf-&gt;FancyTables($headers,$data);
  
  $pdf-&gt;Output();
  $pdf-&gt;Ln; 
  
  
  ?&gt;
  </code></pre>
  
  <p>Thank you so much for your help</p>