title: Gallery View of Images taken from DB in html
body: <p>I have almost 200 images in my List. </p>
  
  <pre><code>$rings = $db-&gt;query("SELECT * FROM rings WHERE id &gt; ". $ringId ." LIMIT 100"); 
  </code></pre>
  
  <p>I want to display them in a Gallery form with a Checkbox to each. Each Row must contains atleast 4 images with their checkboxes.</p>
  
  <p>I have tried, making a for loop with adding div but that only adds vertically with on Ring at a time. How can i give it some sort of gallery look.</p>
  
  <pre><code>&lt;div&gt;
  
                                      &lt;?php
                                              echo "&lt;table&gt;&lt;tr&gt;";
                                              $i =0;
                                              foreach( $rings as $ring )
                                              {
                                                 $i++;
                                                 echo '&lt;td&gt;&lt;input type="image" src="http://thevowapp.com/iphoneapp/vowstore/rings/'.  $ring['imagePath'] .'" name="checked" value="' . $ring['id'].'" data-my-info="'. $ring['ringSetName'] .'" style="width:280px; height:280px;"&gt;&lt;/td&gt;';
                                                 echo '&lt;input type="checkbox"&gt;';
                                                 if( $i % 3 == 0 )
                                                 {
                                                   echo "&lt;/tr&gt;&lt;tr&gt;";
                                                 }
                                               }
                                               echo "&lt;/tr&gt;&lt;/table&gt;";
                                         ?&gt;
                                 &lt;/div&gt;
  </code></pre>