I have tried eliminating the tr where is the sql cosulta and the "?" in my report, but when I add the sql query it generates my report but it also generates this "?" in my report
vista_html.php
<style >
table { vertical-align: top; }
tr { vertical-align: top; }
td { vertical-align: top; }
.midnight-blue{
background:#2c3e50;
padding: 4px 4px 4px;
color:white;
font-weight:bold;
font-size:12px;
}
.silver{
background:white;
padding: 3px 4px 3px;
}
.clouds{
background:#ecf0f1;
padding: 3px 4px 3px;
}
.border-top{
border-top: solid 1px #bdc3c7;
}
.border-left{
border-left: solid 1px #bdc3c7;
}
.border-right{
border-right: solid 1px #bdc3c7;
}
.border-bottom{
border-bottom: solid 1px #bdc3c7;
}
table.page_footer {width: 100%; border: none; background-color: white; padding: 2mm;border-collapse:collapse; border: none;}
}
</style>
<page backtop="15mm" backbottom="15mm" backleft="15mm" backright="15mm" style="font-size: 12pt; font-family: arial" >
<page_header>
Page Header
</page_header>
<page_footer>
Page Footer
</page_footer>
<table cellspacing="0" style="width: 100%; text-align: left; font-size: 10pt;">
<tr>
<th style="width: 20%;text-align:center" class='midnight-blue'>CANT.</th>
<th style="width: 60%" class='midnight-blue'>DESCRIPCION</th>
<th style="width: 20%;text-align: right" class='midnight-blue'>PRECIO UNIT.</th>
</tr>
<?php
$id= intval($_GET['id']);
require_once "./../config/Conexion.php";
$nums=1;
$sql=mysqli_query($conexion,"select * from cuota where id='".$id."'");
while ($row=mysqli_fetch_array($sql))
{
$idd=$row[0];
$nombre=$row[1];
$cost=$row[2];
if ($nums%2==0){
$clase="clouds";
} else {
$clase="silver";
}
?>
<tr>
<td class='<?php echo $clase;?>' style="width: 20%; text-align: center"><?php echo $idd;?></td>
<td class='<?php echo $clase;?>' style="width: 60%; text-align: left"><?php echo $nombre;?></td>
<td class='<?php echo $clase;?>' style="width: 20%; text-align: right"><?php echo $cost;?></td>
</tr>
<?php
$nums++;
}
?>
</table>
</page>
// my file where you call vista_html.php
<?php
require __DIR__.'/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Exception\Html2PdfException;
use Spipu\Html2Pdf\Exception\ExceptionFormatter;
try {
ob_start();
include dirname(__FILE__).'/res/vista_html.php';
$content = ob_get_clean();
$html2pdf = new Html2Pdf('p', 'A4', 'es');
$html2pdf->pdf->SetDisplayMode('fullpage');
$html2pdf->writeHTML($content);
$html2pdf->output('pdf_generate.pdf');
} catch (Html2PdfException $e) {
$html2pdf->clean();
$formatter = new ExceptionFormatter($e);
echo $formatter->getHtmlMessage();
}
?>