|
|
|
สอบถามผู้รู้หน่อย ครับ การใช้งาน mPDF ทำอย่างให้หัวตารางไม่ทับ Header ของกระดาษ |
|
|
|
|
|
|
|
จากภาพผมตั้ง Header ไว้ แต่ตารางข้อมูลกลับมาทับ Header
ผมต้องการให้หัวตารางเลื่อนลงมาอีกทุกหน้า เท่าๆ กัน
หรือมีวิธีการตั้งค่า Header ยังไงให้ทุกหน้าเหมือนกัน
Code (PHP)
<link type="text/css" href="style.css" />
<?php
require_once('../mpdf/mpdf.php');
$html = '
<main>
<table>
<thead>
<tr>
<th class="service">SERVICE</th>
<th class="desc">DESCRIPTION</th>
<th>PRICE</th>
<th>QTY</th>
<th>TOTAL</th>
</tr>
</thead>
<tbody>
<tr>
<td class="service">Design</td>
<td class="desc">Creating a recognizable design solution based on the company existing visual identity</td>
<td class="unit">$40.00</td>
<td class="qty">26</td>
<td class="total">$1,040.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr><tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">Development</td>
<td class="desc">Developing a Content Management System-based Website</td>
<td class="unit">$40.00</td>
<td class="qty">80</td>
<td class="total">$3,200.00</td>
</tr>
<tr>
<td class="service">SEO</td>
<td class="desc">Optimize the site for search engines (SEO)</td>
<td class="unit">$40.00</td>
<td class="qty">20</td>
<td class="total">$800.00</td>
</tr>
<tr>
<td class="service">Training</td>
<td class="desc">Initial training sessions for staff responsible for uploading web content</td>
<td class="unit">$40.00</td>
<td class="qty">4</td>
<td class="total">$160.00</td>
</tr>
<tr>
<td class="service">Training</td>
<td class="desc">Initial training sessions for staff responsible for uploading web content</td>
<td class="unit">$40.00</td>
<td class="qty">4</td>
<td class="total">$160.00</td>
</tr>
<tr>
<td class="service">Training</td>
<td class="desc">Initial training sessions for staff responsible for uploading web content</td>
<td class="unit">$40.00</td>
<td class="qty">4</td>
<td class="total">$160.00</td>
</tr>
<tr>
<td class="service">Training</td>
<td class="desc">Initial training sessions for staff responsible for uploading web content</td>
<td class="unit">$40.00</td>
<td class="qty">4</td>
<td class="total">$160.00</td>
</tr>
<tr>
<td class="service">Training</td>
<td class="desc">Initial training sessions for staff responsible for uploading web content</td>
<td class="unit">$40.00</td>
<td class="qty">4</td>
<td class="total">$160.00</td>
</tr>
<tr>
<td class="service">Training</td>
<td class="desc">Initial training sessions for staff responsible for uploading web content</td>
<td class="unit">$40.00</td>
<td class="qty">4</td>
<td class="total">$160.00</td>
</tr>
<tr>
<td colspan="4">SUBTOTAL</td>
<td class="total">$5,200.00</td>
</tr>
<tr>
<td colspan="4">TAX 25%</td>
<td class="total">$1,300.00</td>
</tr>
<tr>
<td colspan="4" class="grand total">GRAND TOTAL</td>
<td class="grand total">$6,500.00</td>
</tr>
</tbody>
</table>
<div id="notices">
<div>NOTICE:</div>
<div class="notice">A finance charge of 1.5% will be made on unpaid balances after 30 days.</div>
</div>
</main>';
$header = '<div id="project">
<div><span>PROJECT</span> Website development</div>
<div><span>CLIENT</span> John Doe</div>
<div><span>ADDRESS</span> 796 Silver Harbour, TX 79273, US</div>
<div><span>EMAIL</span> <a href="mailto:[email protected]">[email protected]</a></div>
<div><span>DATE</span> August 17, 2015</div>
<div><span>DUE DATE</span> September 17, 2015</div>
</div>';
$footer = '<div>hhhhhhhhhhhhhhhh</div>';
$mpdf = new mPDF('c', 'A4','0','');
$mpdf->SetHTMLHeader($header);
$mpdf->writeHTML($html,2);
$mpdf->SetFooter($footer);
$mpdf->Output('reporte.pdf', 'I');
?>
Tag : PHP, MySQL, Windows
|
|
|
|
|
|
Date :
2017-02-10 11:22:14 |
By :
apiwat5656 |
View :
1345 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ทำเป็น PDF ครับ CSS ยังไม่ได้เขียน ครับ
|
|
|
|
|
Date :
2017-02-10 11:43:48 |
By :
apiwat5656 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 04
|