title: Dynamic HTML Table's td and tr not working properly depending on the condition
body: <p>I' am storing the values in an array and then looping through it and creating dynamic HTML td and tr depedning on the condition. The table tr should break to next tr when the loop increament value is 6 and 11.</p>
  
  <p>I' am not sure what I' am I missing here. Everything does look okay. Here is the <a href="http://s9.postimg.org/g38hs7u33/table.jpg" rel="nofollow">screenshots</a> </p>
  
  <p><strong>PHP CODE</strong></p>
  
  <pre><code>&lt;table class="table table-condensed" id="tblareaXP"&gt;
      &lt;thead&gt;
        &lt;tr&gt;
          &lt;th colspan="5"&gt;Areas of Expertise&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
        &lt;?php
          $i = 0;
          $array = array(
            "Program Management" =&gt; "Program Management",
            "Finance Administration" =&gt; "Finance Administration",
            "Training  Facilitation" =&gt; "Training  Facilitation",
            "Operations  Logistics" =&gt; "Operations  Logistics",
            "Communications  Media" =&gt; "Communications  Media",
            "Monitoring  Evaluation" =&gt; "Monitoring  Evaluation",
            "Board Goveranance" =&gt; "Board Goveranance",
            "Research  Learning" =&gt; "Research  Learning",
            "Strategic Planning" =&gt; "Strategic Planning",
            "Program Design" =&gt; "Program Design",
            "Other Area" =&gt; "Other Area"
          );
          foreach( $array as $key =&gt; $item ){
              $i++;
        ?&gt;
              &lt;?php if( $i == 6 or $i == 11 ){ ?&gt;&lt;tr&gt;&lt;?php } ?&gt;
        &lt;td&gt;&lt;input type="checkbox" name="prodevxp" value="&lt;?php echo $key; ?&gt;"&gt;&lt;label for=""&gt;&amp;nbsp;&lt;?php echo $item; ?&gt;&lt;/label&gt;&lt;/td&gt;
        &lt;?php if( $i == 6 or $i == 11 ){ ?&gt;&lt;/tr&gt;&lt;?php } ?&gt;
        &lt;?php } ?&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  </code></pre>