【发布时间】:2017-10-12 12:48:03
【问题描述】:
我的代码 html 是这样的:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>Print PDF</title>
<style type="text/css">
.footer { position: fixed; left: 0px; right: 0px; height: 50px;text-align: center; }
.footer .pagenum:before { content: counter(page); }
</style>
</head>
<body>
<h1>This is test</h1>
<table class="tg">
<tr>
<th class="tg-3wr7">kolom 1</th>
<th class="tg-3wr7">kolom 2</th>
<th class="tg-3wr7">kolom 3</th>
<th class="tg-3wr7">kolom 4</th>
<th class="tg-3wr7">kolom 5</th>
</tr>
@php ($row = 22)
@for($i=0;$i<$row;$i++)
<tr>
<td class="tg-rv4w">test 1</td>
<td class="tg-rv4w">test 1</td>
<td class="tg-rv4w">test 1</td>
<td class="tg-rv4w">test 1</td>
<td class="tg-rv4w">test 1</td>
</tr>
@endfor
</table>
<div class="footer">
<span class="pagenum"></span>
</div>
</body>
</html>
如果 $row = 22,它将只显示 1 个这样的页面:
如果$row = 202,会这样显示7页;
多页时,第一页不显示页码。
但是当只有一页时,第一页显示页码
我想要的是:
我想在只有一页的时候让页码消失
我该怎么做?
【问题讨论】:
-
向我们展示您导出到 pdf 的代码
标签: php html css laravel dompdf