alignment html image php tcpdf

How to align image in table td, tcpdf

I use tcpdf to generate pdf files.

And there’s a problem in aligning image in table td.

I am uising $pdf->writeHTML($html, true, false, true, false, ''); in tcpdf.

enter image description here

html is clear from the image i have shared.
html is just simple as

<td style="text-align:center"><img src="" width="20" height="20" ></td>

Note: align=”center”, valign=”middle” , css margin and padding … nothing seems to work I tried on

text-align:center push into center but not vertically.

Adding the following CSS to your td should work:

td {
vertical-align: middle;

See a fiddle of it working.