1
DOMPDFを使用して請求書を作成しています。私はいくつかのdivを横に並べる必要があります。 float要素が機能していません。私は列1DOMPDFには2つのdivが並んでいますか? PHP
以下<?php
require_once "dompdf/dompdf_config.inc.php";
$dompdf = new DOMPDF();
$html ='
<html>
<link type="text/css" href="pdf.css" rel="stylesheet"/>
<body>
<div class="columns">
<div class="red" >Column 1</div>
<div class="grey">Column 2</div>
<div class="red" >Column 3</div>
</div>
<div class="clear"></div>
</body>
</html>
';
$dompdf->load_html($html);
$dompdf->render();
//$dompdf->stream("hello.pdf");
$dompdf->stream('my.pdf',array('Attachment'=>0));
?>
横に2列を取得しようとしていますCSS
div.columns { width: 50%; }
div.columns div { width: 50%; height: 100px; float: left; }
div.grey { background-color: #cccccc; }
div.red { background-color: #e14e32; }
div.clear { clear: both; }