簡體   English   中英

表格內的TCPDF圖像底部對齊

[英]TCPDF image bottom alignment inside table

我正在嘗試將圖像與td元素的底部對齊,以實現類似的效果(三個圖像(與其他圖像的高度無關,將始終位於td的底部)):

預期的:

TCPDF圖像對齊預期

使用以下標記:

    <?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');

但是,TCPDF不支持填充或邊距規則,並且我得到以下結果:

現實:

TCPDF圖像未與底部對齊

官方文檔中有align bottom屬性,但是它不起作用。

注意:值得一提的是,圖像周圍沒有透明像素(在重要的頂部或底部...),例如:

TCPDF簽名無邊距

提前致謝 !

可悲的是,TCPDF最終沒有支持填充或邊距,這意味着我需要的東西在技術上是不可能的。 我決定轉到使用CSS規則( 特別是本文中提到的垂直對齊)允許這種行為的Dompdf

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM