title: Creating Modal Images Using PHP and JavaScript
body: <p>I have created a page that places images in a table and I would like to able to click on each thumbnail to open a dialog box/popup window on top of the current page that displays a larger image. I have looked at w3schools.com (<a href="https://www.w3schools.com/howto/howto_css_modal_images.asp" rel="nofollow noreferrer">https://www.w3schools.com/howto/howto_css_modal_images.asp</a>) and can easily replicate this for single, but not for multiple images. Is it possible? Any pointers would be appreciated.</p>
  <p>Here is my PHP code that generates the table containing my images:</p>
  <pre><code>&lt;div class=&quot;Row&quot;&gt;
  &lt;?php
  $counter = 0;
  while ( $row = mysqli_fetch_array( $rs4 ) ) {
    ?&gt;
  &lt;div class=&quot;Cell&quot;&gt;
    &lt;p&gt; &lt;img src =&quot;&lt;?php echo $row ['image']; ?&gt;&quot;&gt;&lt;/a&gt; 
  &lt;/div&gt;
  &lt;?php++$counter;
  if ( is_int( $counter / 3 ) ) {
    echo '&lt;/div&gt;&lt;div class=&quot;Row&quot;&gt;';
  }
  ?&gt;
  &lt;?php
  }
  ?&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/T7Cwo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/T7Cwo.png" alt="enter image description here" /></a></p>