这是我在 PdfHtml 类中的代码:
public function createTable($result){
$html = "<html>
<body>
<table>
<th>
<td>Descripción</td>
<td>Artículo</td>
<td>Precio</td>
</th>
";
while($row = mysql_fetch_array($result)){
$html .= "<tr>";
$html .= "<td>".$row["producto"]."</td>";
$html .= "<td>".$row["idProducto"]."</td>";
$html .= "<td>".$row["precio"]."</td>";
$html .= "</tr>";
}
$html .= "</table>
</body>
</html>";
return $html;
}
</i>
我执行以下操作:
$pdfHtml = new PdfHTML();
$result = $pdfHtml->getProductosPorMarca($idMarca);
$html = $pdfHtml->createTable($result);
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->output();
并抛出这个:
Catchable fatal error: Argument 1 passed to DOMNode::appendChild() must be an instance of DOMNode, null given, called in /opt/lampp/htdocs/ONLINE/dompdf0.6/include/table_frame_decorator.cls.php on line 304 and defined in /opt/lampp/htdocs/ONLINE/dompdf0.6/include/frame.cls.php on line 726
请帮助我,我没有发现我的错误在哪里!!!谢谢!!