Php 如何使右边框表tcpdf更小?
我尝试使用Php 如何使右边框表tcpdf更小?,php,css,tcpdf,Php,Css,Tcpdf,我尝试使用writeHTML创建tcpdf,就像这样$pdf->writeHTML($html,true,0,false,0)哪个$html值与下面的代码类似 <table border="1"> <tr> <td width="100%" colspan="4"> <table border="0"> <tr>
writeHTML
创建tcpdf,就像这样$pdf->writeHTML($html,true,0,false,0)
哪个$html
值与下面的代码类似
<table border="1">
<tr>
<td width="100%" colspan="4">
<table border="0">
<tr>
<td width="18%" style="border-right:0.01px">Test 1</td>
<td width="12%">Test 2</td>
<td width="20%">Test 3</td>
</tr>
<tr>
<td width="18%" style="border-right:0.01px">Test 4</td>
<td width="12%">Test 5</td>
<td width="20%">Test 6</td>
</tr>
</table>
</td>
</tr>
</table>
测试1
测试2
测试3
测试4
测试5
测试6
style=“border right:0.01px”
或style=“border right:0.1px”
或style=“border right:1px”
提供相同的边框宽度结果,如何使此右边框更小?因为我的结果在测试1和测试4上的右边界是最大的,然后是外部边界。如果你在边界定义上更明确一点,它会像你期望的那样工作。TCPDF的HTML/CSS解析器相当有限,因此它有助于尽可能具体地使用样式规则等
您的代码应该使用右边框宽度:0.1px
或其他CSS属性作为右边框的缩写,请参见下面的示例HTML和附带的渲染PDF屏幕截图(缩放以突出显示差异)
测试1
测试2
测试3
测试4
测试5
测试6
试验中断
测试:)
测试:)
如您所见,它使用较薄的边框处理前两个定义。我使用style=“border right color:white”来隐藏右边框
<td style="border-right-color:white; border-bottom-color:black; border-top-color:black"></td>
1px是最小的,不能使用半像素或十分之一像素。如何使右边框线高度与外边框线高度相同?@hilarisdoren您尝试过使用:table{border collapse:collapse;}
@SuperDJ its对我仍然不起作用请上传一个工作的JSFIDLE。我试着复制你的代码,但我没有看到任何与你的问题类似的东西。为什么边框的白色看起来像灰色?这非常有用!我有个问题。如果背景色是其他颜色,那么边框颜色应该与背景色相同?
<td style="border-right-color:white; border-bottom-color:black; border-top-color:black"></td>