javascript - Gallery View of Images taken from DB in html -


i have 200 images in list.

$rings = $db->query("select * rings id > ". $ringid ." limit 100");  

i want display them in gallery form checkbox each. each row must contains atleast 4 images checkboxes.

i have tried, making loop adding div adds vertically on ring @ time. how can give sort of gallery look.

<div>                                      <?php                                             echo "<table><tr>";                                             $i =0;                                             foreach( $rings $ring )                                             {                                                $i++;                                                echo '<td><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;"></td>';                                                echo '<input type="checkbox">';                                                if( $i % 3 == 0 )                                                {                                                  echo "</tr><tr>";                                                }                                              }                                              echo "</tr></table>";                                        ?>                                </div> 

your need control output outputs horizontally until have 4 images in row, start new row.

also, might suggest table structures this.

echo "<table>        <tr>"; $i=0; foreach( $rings $ring ):   $i++   echo "<td><img src='{$ring['thumb']}' /></td>";   if( $i % 4 == 0 ){     echo "</tr><tr>";   } } echo "</tr></table>"; 

Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

datatable - Matlab struct computations -