【发布时间】:2014-08-13 04:01:18
【问题描述】:
制作方法
<tr>
<th>a</th>
<th>b</th>
<th>c</th>
<th>d</th>
<th>e</th>
</tr>
始终可在每一页上打印。
我的观点
<style>
@page { margin: 150px 50px; }
#header { position: fixed; left: 0px; top: -100px; right: 0px; height: 50px; text-align: center; }
#footer { position: fixed; left: 0px; bottom: -180px; right: 0px; height: 150px; text-align: center; }
#footer .page:after { content: counter(page, upper-roman); }
</style>
<div id="header">
<h1>Tittle</h1>
</div>
<div id="content">
<?php
echo"<table class='gridtable'>";
?>
<table width="100%" page-break-inside: auto;>
<tr>
<th>a</th>
<th>b</th>
<th>c</th>
<th>d</th>
<th>e</th>
</tr>
<?php
$num = 0;
foreach($result as $key=>$val){
$num++;
echo"<tr>
<td>".$a."</td>".
"<td>".$val['b']."</td>".
"<td>".$val['c']."</td>".
"<td>".$val['d']."</td>".
"<td>".$val['e']."</td>".
"</tr>";
}
?>
</table>
<?php
echo"</table>";
?>
</div>
<script type="text/php">
if ( isset($pdf) ) {
$font = Font_Metrics::get_font("helvetica", "bold");
$pdf->page_text(280, 780, "Page {PAGE_NUM} of {PAGE_COUNT}", $font, 10, array(0,0,0));
}
</script>
例如,这是我下载后的 PDF
第一页:
| Title 1 | Tittle 2 | Tittle 3 |
| row 1 | row 1 | row 1 |
第二页:
| row 2 | row 2 | row 2 |
如何制作这样的第二页:
| Title 1 | Tittle 2 | Tittle 3 |
| row 2 | row 2 | row 2 |
我希望标题总是打印在每一页的顶部。谢谢你
【问题讨论】:
-
请详细说明您的问题
标签: html codeigniter