1
我想打印一張PDF格式,下面的代碼在瀏覽器中正確顯示enter image description here,但是當pdf生成結構改變位置enter image description here .... im using dompdf ......dompdf colspan無法正常工作
enter code here<table class="table table-bordered table-striped" border='1' style="border-collapse: collapse;width:100%">
<tr>
<td rowspan="4" style="font-weight: bold">Time</td>
<td colspan="14" style="font-weight: bold;text-align: center">Type Of Accident</td>
</tr>
<tr>
<td colspan="7" style="font-weight: bold;text-align: center">URBAN</td>
<td colspan="7" style="font-weight: bold;text-align: center">RURAL</td>
</tr>
<tr>
<td rowspan="2" style="font-weight: bold">F</td>
<td rowspan="2" style="font-weight: bold">GI</td>
<td rowspan="2" style="font-weight: bold">MI</td>
<td rowspan="2" style="font-weight: bold">NI</td>
<td rowspan="2" style="font-weight: bold;text-align: center">Total Number of Accidents</td>
<td colspan="2" style="font-weight: bold;text-align: center">No. Of Persons</td>
<td rowspan="2" style="font-weight: bold">F</td>
<td rowspan="2" style="font-weight: bold">GI</td>
<td rowspan="2" style="font-weight: bold">MI</td>
<td rowspan="2" style="font-weight: bold">NI</td>
<td rowspan="2" style="font-weight: bold;text-align: center">Total Number of Accidents</td>
<td colspan="2" style="font-weight: bold;text-align: center">No. Of Persons</td>
</tr>
<tr>
<td style="font-weight: bold">Killed</td>
<td style="font-weight: bold">Injury</td>
<td style="font-weight: bold">Killed</td>
<td style="font-weight: bold">Injury</td>
</tr></table>
我可以使用上面的代碼生成一個表格[參考上下文中的第一個圖像附加] .....但是當我把這些代碼放在dompdf(css到pdf生成器)時,結構改變[參考第二個圖像附加在背景] ....... –