我在google和stackoverflow中发现了许多相关的内容,但这对我的结果没有影响。我的数据超过40000行,我想打印自动下一页和修复数据中断行。
并为每一页设置页码。
<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;试了很多次
但这不是工作。
发布于 2017-02-08 16:35:46
对于和我遇到同样问题的人,我通过设置每页打印行数限制来解决这个问题
.table_print tbody tr:nth-of-type(32n){page-break-after: always;}https://stackoverflow.com/questions/42106309
复制相似问题