简体   繁体   中英

TCPDF image bottom alignment inside table

I'm trying to align images to the bottom of a td element to achieve something like this (the three images, independently from the height of the other images, will be always on the bottom of the td):

Expectative:

TCPDF图像对齐预期

With the following markup:

    <?php 

    // create some HTML content
    $html = '<h1>Image alignments on HTML table</h1>
    <table cellpadding="0" cellspacing="0" border="1" style="text-align:center;">
        <tr>
            <td width="33%">
                <img src="signature1.png" border="0" align="bottom"/>
            </td> 
            <td width="33%">
                <img src="signature2.png" border="1" align="bottom" style="margin-bottom: 0px;" />
            </td>
            <td width="33%" align="bottom">
                <img src="signature3.png" border="0" align="bottom" style="padding: 5px;" />
            </td>
        </tr>
    </table>';

    // output the HTML content
    $pdf->writeHTML($html, true, false, true, false, '');

    //Close and output PDF document
    $pdf->Output('example_006.pdf', 'I');

However TCPDF doesn't support padding nor margin rules and i'm getting the following result:

Reality:

TCPDF图像未与底部对齐

In the official documentation there's the align bottom property but it doesn't work.

Note: it's worth to say that the images don't have transparent pixels around them (on top or bottom where it matters ... ) eg:

TCPDF签名无边距

Thanks in advance !

Pitifully TCPDF ended up without support for padding or margin, which means that what i needed wasn't technically possible. I decided to move to Dompdf that allows this behaviour using CSS rules ( specifically vertical align, mentioned in this article ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM