I am trying to display images extracted from a database in a table using PHP, which has been successful so far. However, some of my text descriptions are too long and longer than individual thumbnails.
This is a general view for my table. 
And this is an enlarged version of an example of the problem I encountered 
As you can see, the word βACCOUNTINGβ is too large. I would like to establish that the text will be set on the border of the image, the width is 350 pixels for all my images. These are my php codes for a table if that helps.
echo "<table width = '100%' height ='100%'><tr>"; $rows_fetched = - 1; while ($stmt->fetch()) { $rows_fetched++; if ($rows_fetched <= 2) { echo "<td width = '350px'height = '100%'>"; echo "<a href='video-page.php'> <img src='$thumbnail' alt='' width='350px' height='200px'>"; echo "<h4>$title</h4>"; // echo "<h4> hi </h4>"; echo "</td>"; } else { echo "</tr>"; echo "<tr>"; echo "<td width = '350px' height ='100%' >"; echo "<a class href='video-page.php'> <img src='$thumbnail' alt='' width='350px' height='200px'>"; echo "<h4 class ='img-with-text'>$title</h4>"; // echo "<h4> hi </h4>"; echo "</td>"; $rows_fetched = 0; } } echo "</tr></table>";
source share