title: create PDF using tcpdf
body: <p>I am using tcpdf to create pdf. PDF creation is working but i want to format those data. but i am not getting desired output.
  i want following format for my PDF(Attached image), but i am not getting. Please help to get output in desired format.</p>
  
  <p>my code is this:</p>
  
  <pre><code>&lt;?php  
  
  // Include the main TCPDF library (search for installation path).
  require_once('tcpdf_include.php');
  
  
  // create new PDF document
  $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
  
  // set document information
  $pdf-&gt;SetCreator(PDF_CREATOR);
  $pdf-&gt;SetTitle('Lorem Ipsum');
  $pdf-&gt;SetSubject('TCPDF Tutorial');
  $pdf-&gt;AddPage();
  $appendBlock = '';
  foreach ($res as $key =&gt; $value) {     
    $appendBlock .= '&lt;table&gt;&lt;tr&gt;
    &lt;td&gt;
    &lt;img class="hw" style="width:150px;" src="'.$bar_code.'"&gt; '.$username.'
    &lt;b style="float:right;"&gt;Date:&lt;/b&gt; &lt;br/&gt;
    '9-4-2015'
    'address of the user'
    '887766554433,009988775566'
    &lt;b&gt;Description:&lt;/b&gt;'.Lorem ipsumLorem ipsumLorem ipsumLorem ipsum.'
    &lt;b&gt;ProductCode:&lt;/b&gt;'2012' 'red' '9'
    '10-4-2015'
    &lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
    &lt;hr&gt;';
  }
  
  //mprd($appendBlock);
  // create some HTML content
  $html = '
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  '.$style.'
  &lt;/head&gt;
  &lt;body&gt;
  &lt;section id="page"&gt;
  '.$appendBlock.'
  &lt;/section&gt;
  &lt;/body&gt;
  &lt;/html&gt;';
  // output the HTML content
  //$pdf-&gt;writeHTML($html, true, 0, true, 0);
  
  // set default font subsetting mode
  //$pdf-&gt;setFontSubsetting(true);
  
  // set font
  // $pdf-&gt;SetAutoPageBreak(TRUE, 0);
  $pdf-&gt;SetFont('helvetica', '', 11);
  
  
  // $pdf-&gt;writeHTML($html, '', 0, '', false, 0, false, false, 0);
  $pdf-&gt;writeHTML($html);
  
  // reset pointer to the last page
  $pdf-&gt;lastPage();
  
  // ---------------------------------------------------------
  $name = strtotime('Y-m-d H:i:s');
  //Close and output PDF document
  $pdf-&gt;Output('test.pdf', 'I');
  
  //============================================================+
  // END OF FILE
  //============================================================+
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/6lO3X.png" alt="enter image description here"></p>
  
  <p>I am getting this type of format:
  <img src="https://i.stack.imgur.com/RpcId.png" alt="enter image description here"></p>