表格更改为 pdf 中的新页面后,行跨度不起作用 我使用 laravel-dompdf 获取 pdf
我的桌子代码
<table class="table-sm text-center align-middle">
<tr>
<th rowspan="2">NAMA PASANGAN CALON</th>
<th colspan="15">Rincian Perolehan Suara</th>
<th rowspan="2">Jumlah <br> Tiap <br> Baris</th>
<th rowspan="2">Jumlah</th>
</tr>
<tr>
@for ($i = 1; $i <= 15; $i++)
<td>{{ $i }}</td>
@endfor
</tr>
@for ($c = 0; $c < 3; $c++)
@for ($i = 1; $i <= 11; $i++)
<tr>
@if ($i === 1)
<td rowspan="11">asdkjhasdkjhasdkjhasdjhsjahd and asdjaksdkasdkjkasdjh</td>
@endif
@for ($j = 1; $j <= 15; $j++)
<td>{{ str_repeat('|', 5) }}</td>
@endfor
<td>{{ 5 * 15 }}</td>
@if ($i === 1)
<td class="align-top" rowspan="11">{{ 5 * 15 * 11 }}</td>
@endif
</tr>
@endfor
@endfor
</table>
我希望表格的结果是这样的 在此输入图片描述
2解决方案,缩小你的内容或者放大你的纸张尺寸
此参考资料将帮助您 = 如何使用 dompdf 设置 pdf 的自定义宽度和高度?
//add this
$customPaper = array(0,0,360,360);
$dompdf->setPaper($customPaper);
自行设置自定义分辨率/纸张尺寸。自己尝试一下您需要的尺寸。这只是示例。
或者也许这会对你有帮助
border-spacing: -1px;