title: TCPDF table header with different margin on next page
body: <p>I need to print a pdf with repeated table depend of the number of records it works fine in the first page but on the next the table header change the margins, this is the code to display my table on TCPDF;</p>
  
  <pre><code>$html= '&lt;table cellpadding="5"&gt;
          &lt;tr&gt;
              &lt;td colspan="2" align="center"&gt;&lt;u&gt;&lt;h1&gt;Resumen de Ingresos&lt;/b&gt;
          &lt;/tr&gt;
          &lt;tr&gt;
              &lt;td&gt;De Fecha: {desd_fecha}&lt;/td&gt; &lt;td&gt;A Fecha: {hasta_fecha}&lt;/td&gt;
          &lt;/tr&gt;            
       &lt;/table&gt;';
  $total=0;
  $html .='   &lt;table  border="1" cellpadding="5" width="100%"&gt;      
          &lt;thead&gt;
          &lt;tr&gt;
                  &lt;th style= "width: 150px";&gt;Fecha&lt;/th&gt;
                  &lt;th style= "width: 90px";&gt;Nro. Doc.&lt;/th&gt;
                  &lt;th style= "width: 280px";&gt;Proveedor&lt;/th&gt;
                  &lt;th style= "width: 180px";&gt;Almacen&lt;/th&gt;
                  &lt;th style= "width: 90px"; &gt;Costo&lt;/th&gt;
          &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;';     
  foreach ($datos_pdf as $datos_pdfs){
  $total += $datos_pdfs["DetAsiento"]["haber"];  
  $html .='
      &lt;tr&gt;
          &lt;td align="center" style= "width: 150px";&gt;'.date("d-m-Y", strtotime($datos_pdfs['CabAsiento']['fecha'])).'&lt;/td&gt;
          &lt;td align="left" style= "width: 90px";&gt;'.$datos_pdfs["CabAsiento"]["nro_doc"].'&lt;/td&gt;
          &lt;td align="left" style= "width: 280px";&gt;'.$datos_pdfs["Category"]["name"].'&lt;/td&gt;
          &lt;td align="left" style= "width: 180px";&gt;'.$datos_pdfs["Category"]["nro_cuenta"].'&lt;/td&gt;
          &lt;td align="left" style= "width: 90px"; &gt;'.$datos_pdfs["DetAsiento"]["haber"].'&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/tbody&gt;'; 
  }
  $html .='
      &lt;tr&gt;
          &lt;td colspan="5" align="right"&gt;&lt;b&gt;Total: '.$total.'&lt;/b&gt;&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/table&gt;';
  $fecha = new DateTime($desde);
  $html = str_replace('{desd_fecha}',$fecha-&gt;format('d/m/Y'),$html);
  $fecha = new DateTime($hasta);
  $html = str_replace('{hasta_fecha}',$fecha-&gt;format('d/m/Y'),$html);
  $pdf-&gt;writeHTML($html, true, false, false, false, '');
  $pdf-&gt;lastPage();
  </code></pre>
  
  <p>and my output for my next page is this:</p>
  
  <p><a href="https://i.stack.imgur.com/oLUxL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/oLUxL.png" alt="enter image description here"></a></p>
  
  <p>how can i fix so the header of the table have the same margin of the first.</p>