2016-10-25 17 views
1

私は私.pdfファイルに追加するために使用されます。このHTMLコードを持っている:以下DOMPDF、表の行の高さ

<style> 
table{ 
    width:783px; 
    height:auto; 
    table-layout:fixed; 
} 
</style> 
<table> 
<tr> 
    <th style="width:783px; height:300px; border:1px solid black;">Firstname</th> 
</tr> 
<tr> 
    <th style="width:783px; height:300px; border:1px solid black;">Firstname</th> 
</tr> 
<tr> 
    <th style="width:783px; height:300px; border:1px solid black;">Firstname</th> 
</tr> 
<tr> 
    <th style="width:783px; height:300px; border:1px solid black;">Firstname</th> 
</tr> 
<tr> 
    <th style="width:783px; height:300px; border:1px solid black;">Firstname</th> 
</tr> 
<tr> 
    <th style="width:783px; height:300px; border:1px solid black;">Firstname</th> 
</tr> 
<tr> 
    <th style="width:783px; height:300px; border:1px solid black;">Firstname</th> 
</tr> 
</table> 

は私.pdfファイルを生成するために使用するコードです:

define("DOMPDF_ENABLE_HTML5PARSER", true); 
define("DOMPDF_ENABLE_FONTSUBSETTING", true); 
define("DOMPDF_UNICODE_ENABLED", true); 
define("DOMPDF_DPI", 120); 
define("DOMPDF_ENABLE_REMOTE", true); 

//Configure the directory where you have the dompdf 
require_once "dompdf/autoload.inc.php"; 
use Dompdf\Dompdf; 
//$dompdf = new dompdf(); 
//$dompdf = new DOMPDF(); 
$dompdf = new Dompdf(); 
$dompdf->loadHtml($htmlOut); 
// (Optional) Setup the paper size and orientation 
$dompdf->setPaper('A4', 'portrait'); 
// Render the HTML as PDF 
$dompdf->render(); 
// Output the generated PDF to Browser 
$dompdf->stream(); 

このコードは、一つの問題...私は私のPDFファイルを開くと、最初のページには、高さが正常である私の行は高さの300ピクセル持っている(300ピクセルた)2ページ目の最初の行が300ピクセルを持っていますその後、彼らは正常な高さに戻ります。

何が起こっているのですか?この問題をどうやって解決できますか?

答えて

1

Hmm、それは奇妙です。これらのソリューションの1つを試みるのはどうですか?

<th style="width:783px; height:300px; min-height:300px; border:1px solid black;">Firstname</th> 

または

<th><div style="width:783px; height:300px; min-height:300px; border:1px solid black;">Firstname</div></th> 

私は結果を聞くに興味があります。

+0

2回目のチャンスが機能します!ありがとう!

Firstname
Lacrifilm