title: how to cut or break the loop of modulo and continue the loop in separate html table
body: <p>badly need assistance how to break modulo in visible by 3 but i need it loop or continue the loop in separate html table, because in my mine.. it will continuing the loop like below</p>
  
  <p>Sample_table</p>
  
  <pre><code>|     1    |
  |     2    |
  |     3    |
  |     4    |
  |     5    |
  |     6    |
  </code></pre>
  
  <p>Current output</p>
  
  <pre><code>|     1    |     2   |     3    |
  |     4    |     5   |     6    |
  </code></pre>
  
  <p>Desired Output</p>
  
  <pre><code>HTML table page 1
  |     1    |     2   |     3    |
  
  HTML table page 2
  |     4    |     5   |     6    |
  </code></pre>
  
  <p>My current code</p>
  
  <pre class="lang-php prettyprint-override"><code>//$resultz =  explode('xxx',$result['0']['tanning']);
  //$i = 0;  
  $i=0;
  foreach($result as $results) {
      if ($i%3 == 0) {
          echo  "&lt;/tr&gt;&lt;td&gt;&lt;b&gt;TITLE &lt;br&gt;&lt;/b&gt;&lt;/td&gt;";
          echo  "&lt;td&gt;".$results['data1']."&lt;/td&gt;";
      } else {
          echo  "&lt;td&gt;".$results['data1']."&lt;/td&gt;";
      }
      $i++;
  }
  echo "&lt;/tr&gt;";
  </code></pre>
  
  <p>Thankss</p>