首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >介质打印分页打印pdf

介质打印分页打印pdf
EN

Stack Overflow用户
提问于 2017-02-08 14:38:33
回答 1查看 359关注 0票数 1

我在google和stackoverflow中发现了许多相关的内容,但这对我的结果没有影响。我的数据超过40000行,我想打印自动下一页和修复数据中断行。

并为每一页设置页码。

代码语言:javascript
复制
<table cellspacing="0" class="table table_print" border="1">
<thead>
<tr>
    <th>Num</tr>
    <th>Name</th>
    <th>Address</th>
    <th>Contact</th>
    <th>Jan</th>
    <th>Feb</th>
    <th>Mar</th>
    <th>Apr</th>
    <th>May</th>
    <th>Jun</th>
    <th>Jul</th>
    <th>Aug</th>
    <th>Sep</th>
    <th>Oct</th>
    <th>Nov</th>
    <th>Dec</th>
</tr>
</thead>
<tbody>
<tr>
    <td rowspan="2" scope="rowgroup"><?php echo $i; ?></td>
    <td rowspan="2" scope="rowgroup"><?php echo $name; ?></td>
    <td rowspan="2" scope="rowgroup"><?php echo $address; ?></td>
    <td rowspan="2" scope="rowgroup"><?php echo $contact; ?></td>
    <td scope="row"><?php echo $data[$i]['jan_price']; ?></td>
    <td scope="row"><?php echo $data[$i]['feb_price']; ?></td>
    <td scope="row"><?php echo $data[$i]['mar_price']; ?></td>
    <td scope="row"><?php echo $data[$i]['apr_price']; ?></td>
    <td scope="row"><?php echo $data[$i]['may_price']; ?></td>
    <td scope="row"><?php echo $data[$i]['jun_price']; ?></td>
    <td scope="row"><?php echo $data[$i]['jul_price']; ?></td>
    <td scope="row"><?php echo $data[$i]['aug_price']; ?></td>
    <td scope="row"><?php echo $data[$i]['sep_price']; ?></td>
    <td scope="row"><?php echo $data[$i]['oct_price']; ?></td>
    <td scope="row"><?php echo $data[$i]['nov_price']; ?></td>
    <td scope="row"><?php echo $data[$i]['des_price']; ?></td>
</tr>
<tr>
    <td scope="row"><?php echo $data[$i]['jan_grand']; ?></td>
    <td scope="row"><?php echo $data[$i]['feb_grand']; ?></td>
    <td scope="row"><?php echo $data[$i]['mar_grand']; ?></td>
    <td scope="row"><?php echo $data[$i]['apr_grand']; ?></td>
    <td scope="row"><?php echo $data[$i]['may_grand']; ?></td>
    <td scope="row"><?php echo $data[$i]['jun_grand']; ?></td>
    <td scope="row"><?php echo $data[$i]['jul_grand']; ?></td>
    <td scope="row"><?php echo $data[$i]['aug_grand']; ?></td>
    <td scope="row"><?php echo $data[$i]['sep_grand']; ?></td>
    <td scope="row"><?php echo $data[$i]['oct_grand']; ?></td>
    <td scope="row"><?php echo $data[$i]['nov_grand']; ?></td>
    <td scope="row"><?php echo $data[$i]['des_grand']; ?></td>
</tr>
</tbody>
</table>

我用page-break-after: always; page-break-inside: avoid; page-break-before: avoid;试了很多次

但这不是工作。

EN

回答 1

Stack Overflow用户

发布于 2017-02-08 16:35:46

对于和我遇到同样问题的人,我通过设置每页打印行数限制来解决这个问题

代码语言:javascript
复制
.table_print tbody tr:nth-of-type(32n){page-break-after: always;}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/42106309

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档