I have an html row which display multiple images. Sometimes, number of images exceeds the screen width. So I want to display the images in the next row if the $columnNumber is a division of 3 ($columnNumber%3==0).
I have the following code to display images:
$AllCommentImages = explode(",", $jsonArray[$jsonIndex]['Comment_Image']);
$html.='<tr><td><b>Photos:</b></td></tr>';
$columnNumber=0;
$html.='<tr>';
foreach($AllCommentImages as $cimg)
{
$commentmysock = getimagesize($cimg);
$html.='<td><img style="border:15px solid white;border-radius:15px;" src="'.$cimg.'"'.$this->imageResize($commentmysock[0],$commentmysock[1], 200).'/></td>';
$columnNumber++;
}
$html.= '</tr>';
getimagesize is used to reduce the size of the images, the images all are in thumbnail size. I have used this code for pdf generation. I am not sure where to use $columnNumber%3==0 to get 3 images in a row.
<div class="col-4">If you want to make this with table answer commend but you can write less code with bootsrap