我在我的网站上整合了Dompdf。当我试图在其中一个单元格中使用长文本渲染表格时,它会在PDF布局中出错。
HTML
<table border="1" style="width:100%;text-align:center">
<tr>
<th>#</th>
<th>Item Name</th>
<th>Sub Category</th>
<th>Quantity</th>
<th>Unit Price</th>
<th>Total</th>
</tr>
<tr>
<td>1</td>
<td>This is a long cell. Its not breaking</td>
<td>IR Camera</td>
<td>65</td>
<td>545</td>
<td>8942</td>
</tr>
</table>
PHP
<?php
// include autoloader
require_once 'dompdf/autoload.inc.php';
// reference the Dompdf namespace
use Dompdf\Dompdf;
// instantiate and use the dompdf class
$dompdf = new Dompdf();
$html = file_get_contents('print-bill.php');
$dompdf->loadHtml($html);
// (Optional) Setup the paper size and orientation
$dompdf->setPaper('A4', 'potrait');
// Render the HTML as PDF
$dompdf->render();
// Output the generated PDF to Browser
$dompdf->stream('bill.pdf');
?>
一个细胞正在盘旋另一个细胞。句子没有破裂。在HTML布局中,它看起来很好。我有什么遗失的吗?