php - printing table with div to create delete section -


the code posting below, iterates through result set , prints elements (paths images on database) images display in order. 3 images per row. want able have same concept (i.e. 3 images or cells per row) want have div underneath have word delete photo.

$n = 3; echo "<table style='margin-right: 100px;'>"; echo "<tr>"; for($i=1; $i<=count($gallery);$i++){     $temp = array();     $temp = $gallery[$i-1];     echo "<td><div id='gallery_pic'><img id='single_pic' src='". $temp->path . "' /></div></td>";     if($i % $n ==0){         echo "</tr><tr>";     } } echo '</tr>'; echo '</table>'; echo "</table>"; 

the idea owner of profile should able delete photo clicking it. handle not sure how handle printing table same order adding row per row delete word.

simple. add new div right after div#gallery_pic , give width of 100%, force below image...

echo "<table style='margin-right: 100px;'>"; echo "<tr>"; for($i=1; $i<=count($gallery);$i++){     $temp = array();     $temp = $gallery[$i-1];     echo "<td><div id='gallery_pic'><img id='single_pic' src='". $temp->path . "' /></div><div class='delete_wrap'><a href='?delete_id=" . {image_id} . " style='width:100%'>delete</a></div></td>";     if($i % $n ==0){         echo "</tr><tr>";     } } echo '</tr>'; echo '</table>'; echo "</table>"; 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -