I am trying to create a PDF that has three black boxes across the page. I have coded up the following..
<?php
require_once("dompdf_config.inc.php");
$html =
'
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<style type="text/css">
.main
{
border: 0pt solid black;
}
.gutter
{
width: 100px;
border: 1px solid black;
}
.card
{
width:50px;
height:50px;
border: 0px solid black;
}
</style>
</head>
<body>
<table class="main" >
<tbody>
<tr>
<td class="gutter"> </td>
<td class="card"> </td>
<td class="gutter"> </td>
<td class="card"> </td>
<td class="gutter"> </td>
</tr>
</tbody>
</table>
</body>
</html>';
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");
?>
The width attribute is completely ignored. I have 3 very narrow boxes in the top of the sheet.
Try to write style width = 100% for table.
Update the last vertion, it should to work,
dompdf_0-6-0_beta3
download https://code.google.com/p/dompdf/downloads/list
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With