Error: Uncaught DOMPDF_Exception: No block-level parent found. Not good

0

Good afternoon I am trying to generate a pdf through the Dompdf library but I have had the error that I present in the title of the question. I would like to know in what way this could be solved. Thank you PHP CODE:

<?php 
    require_once("dompdf/dompdf_config.inc.php");
    $conexion=mysqli_connect('127.0.0.1','root','','freatico') or die('Error en la conexion a la base de datos');
    $codigoHTML='
    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8">
        <title>Reporte en PDF</title>
        <link rel="stylesheet" type="text/css" href="hojaestilo.css">
    </head>
    <body>
    <table width="100%" border="1px" cellspacing="0" cellpadding="0">
            <tr>
                <td colspan="6" bdcolor="skyblue">REPORTE PDF TABLA MEDICIÓN</td>
            </tr>
            <tr>
                <td><strong>Identificación del Punto</strong></td>
                <td><strong>Nivel Freatico (M)</strong></td>
                <td><strong>Hora(24hrs)</strong></td>
                <td><strong>Fecha (dd/mm/a)</strong></td>
                <td><strong>Cedula Ciudadania - Persona a cargo</strong></td>
                <td><strong>Estado del punto</strong></td>
            </tr>';
    $sql="SELECT * FROM medicion";
    $resultado=mysqli_query($conexion,$sql) or die ('Error en el query database');
    while($res=mysqli_fetch_array($resultado)){
    $codigoHTML.='
        <tr>
            <td>'.$res['idp'].'</td>
            <td>'.$res['Nivel'].'</td>
            <td>'.$res['Hora'].'</td>
            <td>'.$res['Fecha'].'</td>
            <td>'.$res['CCP'].'</td>
            <td>'.$res['SMS'].'</td>
        </tr>';
    }
    $codigoHTML.='
    </table>
    </body>
    </html>';
    $codigoHTML=utf8_encode($codigoHTML);
    $dompdf=new DOMPDF();
    $dompdf->load_Html ($codigoHTML);
    ini_set("memory_limit","128M");
    $dompdf->render();
    $dompdf->stream("Reporte_Tabla_Medicion.pdf"); 
?>
    
asked by Ângel Dâvíd Bermëo 20.06.2018 в 20:15
source

0 answers