title: Side by side multilevel MultiCells in FPDF
body: <p>I am in the process of converting 2 Cells into MultiCells for the purpose of text wrapping within FPDF.  I have followed a post on here which I found very useful to get the 2 MultiCells side by side.  The problem I have is that the MultiCell is within a foreach statement and it overlaps the next MultiCell if the previous MultiCell has multiple lines.  I have tried a couple of options so far including adding onto the height of the MultiCell but I need them to have appropriate height for the content within them.</p>
  
  <p>Then I though well I need to work out the height of each MultiCell and add that too GetY.  I found the code for GetMultiCellHeight() but when trying to use this I remembered that this adds to the position of the current MultiCell and not the position of the NEXT MultiCell.  And this is where I got stuck!</p>
  
  <p>This is the code I have so far:</p>
  
  <pre><code>foreach($final as $row){
  
  // Only loop over the legal fee
  if($row['fee_scale_category_id'] == 3){
  
      $amount_total += $row['amount'];
      $vat_total += $row['vat'];
      $total_total += ($row['amount'] + $row['vat']);
      $fee_amount = $row['amount'];
  
  
  
      $pdf-&gt;SetX(10);
      $pdf-&gt;SetFont('Arial','',9);
  
      $x = $pdf-&gt;GetX();
      $y = $pdf-&gt;GetY();
  
      $multiCellHeight = $pdf-&gt;GetMultiCellHeight(80,6,$row['fee_scale_item'].':',0,"L"); 
  
      if ($multiCellHeight &gt; 6) {
  
          $pdf-&gt;SetXY($x, $y + $multiCellHeight);
  
      } else {
  
          $pdf-&gt;SetXY($x, $y);
  
      }
  
      $pdf-&gt;MultiCell(80,6,$row['fee_scale_item'].':',0,"L");
  
      if ($multiCellHeight &gt; 6) {
  
          $pdf-&gt;SetXY($x+ 80, $y + $multiCellHeight);
  
      } else {
  
          $pdf-&gt;SetXY($x + 80, $y);
  
      }
  
      $pdf-&gt;MultiCell(20,6,substr('Â£', 1, 1).round_me($row['amount'] + $row['vat']),0,"R");
  
  }
  
  }
  </code></pre>
  
  <p>Any help on how I can pass the height of the current MultiCell for use with the next MultiCell would be greatly appreciated!</p>
  
  <p>Kind Regards,</p>
  
  <p>n00bstacker</p>