TCPDF列表项边距 [英] TCPDF list item margin
本文介绍了TCPDF列表项边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在任何地方都找不到.有清单:
Couldn't find it anywhere. Having list:
<ol>
<li>Foo</li>
<li>Bar</li>
<li>Baz</li>
</ol>
和CSS:
ul li, ol li{
margin-bottom: 10px;
}
在浏览器中的预览列表中,margin-bottom
的解释正确.不幸的是,TCPDF
某种程度上无法识别这种样式(在识别包含的css文件的其他部分时).是否有任何技巧/黑客可以使其正常工作?
While previewing list in browser, margin-bottom
is interpreted correctly. Unfortunately, TCPDF
somehow doesn't recognize this style (while recognizing other parts of included css file). Is there any trick/hack to make it work?
推荐答案
tcpdf允许定义HTML标签的垂直空间,请参见方法 TCPDF类文档,使用:
tcpdf allows to define the vertical spaces for HTML tags, see Method setHtmlVSpace of TCPDF Class Documentation, use:
$pdf->setHtmlVSpace(array(
'li' => array(
'h' => 5, // margin in mm
)
));
html元素的名称是键(li),h指定垂直空间
The name of the html-Element is the key (li) and h specifies the vertical space
这篇关于TCPDF列表项边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文