title: Auto sized the cell width with text width using FPDF
body: <p>I am beginning to use the <code>FPDF</code> to export the pdf from the Mysql. Now that i can export the pdf. I have referenced <a href="https://stackoverflow.com/questions/31981530/how-to-auto-resize-the-cell-in-fpdf-using-php">this link</a> and <a href="https://stackoverflow.com/questions/41972271/show-a-link-in-fpdf">this link</a>, but I still cannot change the cell width and text width.
  Could anyone provide any suggestions? Thank you very much.</p>
  
  <pre><code>&lt;?php
  require('mysql_table.php');
  
  class PDF extends PDF_MySQL_Table
  {
  function Header()
  {
  //Title
  $this-&gt;SetFont('Arial','',18);
  $this-&gt;Cell(0,6,'Test',0,1,'C');
  $this-&gt;Ln(10);
  //Ensure table header is output
  parent::Header();
  }
  }
  
  mysql_connect('localhost','root','');
  mysql_select_db('test');
  $query = "SELECT * FROM test";
  $result = mysql_query($query) or die(mysql_error());
  $rowCount = 2;
  while($row = mysql_fetch_array($result)){
  $thisid = $row['ID'];
  $fileName =$row['name'];
  $filepath = $row['path'];
  $date = $row['date'];
  $rowCount++;
  }
  $pdf=new PDF('P','mm',array(1000,1500));
  $pdf-&gt;AddPage();
  $pdf-&gt;Table('select * from test');
  $pdf-&gt;AddPage();
  $pdf-&gt;SetFont('Arial','',14);
  $pdf-&gt;Cell('','',$thisid,1);
  $pdf-&gt;Cell('','',$fileName,1);
  $pdf-&gt;Cell('','','','','','',false,$filepath);
  $pdf-&gt;Cell('','',$date);
  $pdf-&gt;Output();
  ?&gt;
  </code></pre>