[英]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): 我正在尝试将图像与td元素的底部对齐,以实现类似的效果(三个图像(与其他图像的高度无关,将始终位于td的底部)):
Expectative: 预期的:
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: 但是,TCPDF不支持填充或边距规则,并且我得到以下结果:
Reality: 现实:
In the official documentation there's the align bottom property but it doesn't work. 官方文档中有align bottom属性,但是它不起作用。
Note: it's worth to say that the images don't have transparent pixels around them (on top or bottom where it matters ... ) eg:
注意:值得一提的是,图像周围没有透明像素(在重要的顶部或底部...),例如:
Thanks in advance ! 提前致谢 !
Pitifully TCPDF ended up without support for padding or margin, which means that what i needed wasn't technically possible. 可悲的是,TCPDF最终没有支持填充或边距,这意味着我需要的东西在技术上是不可能的。 I decided to move to Dompdf that allows this behaviour using CSS rules ( specifically vertical align, mentioned in this article ).
我决定转到使用CSS规则( 特别是本文中提到的垂直对齐)允许这种行为的Dompdf 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.