title: make multi cells be side by side fpdf
body: <p>So I've learned that I should use multicell so that text won't go past the cell and will wrap. But, one thing I'm still confused with is how to actually get the cells to be beside each other and only go on to a new line when at the end of the row.</p>
  
  <p>My html table is as follows:</p>
  
  <pre><code>&lt;table class="experience" id="experience" &gt;
    &lt;tr&gt;
    &lt;td&gt;&lt;b&gt;Date From/To&lt;/b&gt;&lt;/td&gt;
    &lt;td&gt;&lt;b&gt;Company Name/Address&lt;/b&gt;&lt;/td&gt;
    &lt;td&gt;&lt;b&gt;Job Detail and Brief Outline of Dutie&lt;/b&gt;&lt;/td&gt;
    &lt;td&gt;&lt;b&gt;Reasons For Leaving&lt;/b&gt;&lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;&lt;input type="text" name="job_dates[]" id="job_dates" /&gt;&lt;/td&gt;
    &lt;td&gt;&lt;input type="text" name="company_name[]" id="company_name"/&gt;&lt;/td&gt;
    &lt;td&gt;&lt;input type="text" name="details[]" id="details" /&gt;&lt;/td&gt;
    &lt;td&gt;&lt;input type="text" name="leaving[]" id="leaving"/&gt;&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  &lt;a href="#" title="" class="add-row1"&gt;Add Row&lt;/a&gt;
  </code></pre>
  
  <p>The user is able to add a row by clicking the add row link. This table is just part of my form and it does go to my php file. Now when the user has filled out the form and hit submit, my php file gets the table values with:</p>
  
  <pre><code>$jobDates        = (isset($_POST['job_dates'])   ? $_POST['job_dates']   : array());
  $company          = (isset($_POST['company_name'])     ? $_POST['company_name']     : array());
  $jobDetails  = (isset($_POST['details']) ? $_POST['details'] : array());
  $reasons = (isset($_POST['leaving'])     ? $_POST['leaving']     : array());
  </code></pre>
  
  <p>At the moment I'm displaying the table in my pdf file by doing the following:</p>
  
  <pre><code>$pdf-&gt;Cell(40,10, 'Work Experience');
  
  $pdf-&gt;Ln(20);
  
  $width_cell=array(45,50,30,90);
  
  $pdf-&gt;Cell($width_cell[0],10,'Date From/To',1,0); // First header column 
  $pdf-&gt;Cell($width_cell[1],10,'Company Name',1,0); // Second header column
  $pdf-&gt;Cell($width_cell[2],10,'Job Duties',1,0); // Third header column 
  $pdf-&gt;Cell($width_cell[3],10,'Reason for leaving',1,1); // Fourth header column
  
    $pdf-&gt;SetFont('Arial','',10);
   foreach ($jobDates as $point =&gt; $data) {
    $pdf-&gt;MultiCell($width_cell[0],10,$data,1,'C'); 
    $pdf-&gt;MultiCell($width_cell[1],10,$company[$point],1,'C');
    $pdf-&gt;MultiCell($width_cell[2],10,$jobDetails[$point],1,'L');
    $pdf-&gt;MultiCell($width_cell[3],10,$reasons[$point],1,'C');;
  
  }
  </code></pre>
  
  <p>This however just makes them display one after the other on a new line rather than beside each other. It should only go onto a new line when it is going onto a new row of data (if the user has entered in more than one row in the form)</p>
  
  <p>I've attached an image to show what is happening at the moment<a href="https://i.stack.imgur.com/4Q0k4.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4Q0k4.jpg" alt="enter image description here"></a></p>