Is it possible to put Images in table's **td** tag in mpdf Laravel library

Viewed 436

I am trying to add an 100 X 100 pixel image in a table in mpdf. But the table disappears when I do so.

<table>
   <tr>
       <td><img src="https://someimage.jpg" width=100 height=100></td>
   </tr>
</table>

But when I use tag outside table it fetches the image and shows it perfectly fine.

How do I put image in table in mpdf (is there any trick)?

2 Answers

From my experience when I tried to use MPDF with tables and images inside cells I couldn't manage to set the correct image sizes. I fixed it with div's instead of table. If possible try this solution

It is possible to put images in a table in mpdf. Earlier i was making syntax mistake. I had forgot a comma. Sorry for inconvineance.

<table>
   <tr>
       <td><img src="https://someimage.jpg" style="height:50px; width:100px;"></td>
   </tr>
</table>

Related