【发布时间】:2017-06-25 16:03:04
【问题描述】:
我在 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;
但它不起作用。
【问题讨论】: