以下是我在打印预览中显示数据的代码..
在此表中,我需要在每个页面上重复标题。
我需要在每个页面中只打印10行。之后需要分页并在下一页显示数据数据重复标题......
现在我的概率。是我的代码重复标题后10行但我无法理解如何打破10行后的页面和页面显示在下一页...不在页面的中间...
请帮助我..
<td width="38%"><input type="submit" value="print" onClick="PrintDiv();" /></td>
<table border="1px solid #666" cellpadding='0' cellspacing='0'>
<thead>
<tr>
<th width="4%">Sr.No</th>
<th width="10%">Book / Recpt No</th>
<th width="7%">Booking Dt</th>
<th width="9%">Copy Start Dt</th>
<th width="14%">Surveyor Name</th>
<th width="18%">Customer</th>
<th width="27%">Coupon No</th>
<th width="5%">Price</th>
<th width="6%">Gift Del.</th>
</tr>
</thead>
<?php
$i=1;
$counter=1;
$pageCounter=1;
foreach($data as $row){
?>
<?php
if($counter==11)
{
$counter=1;
?>
<thead>
<tr class="breakAfter">
<th width="4%">Sr.No</th>
<th width="10%">Book / Recpt No</th>
<th width="7%">Booking Dt</th>
<th width="9%">Copy Start Dt</th>
<th width="14%">Surveyor Name</th>
<th width="18%">Customer</th>
<th width="27%">Coupon No</th>
<th width="5%">Price</th>
<th width="6%">Gift Del.</th>
</tr>
</thead>
<?php } ?>
<tbody>
<tr>
<td height="54"><?php echo $i; ?></td>
<td><?php echo htmlspecialchars($row['book_no']); ?> / <?php echo htmlspecialchars($row['receipt_no']); ?></td>
<td><?php echo htmlspecialchars($row['bookingdate']); ?></td>
<td><?php echo htmlspecialchars($row['startingdate']); ?></td>
<td><?php echo htmlspecialchars($row['surveyor_name']); ?></td>
<td><?php echo htmlspecialchars($row['prefix']); ?>,<?php echo htmlspecialchars($row['customer_name']); ?></td>
<td><?php echo htmlspecialchars($row['cou']); ?></td>
<td><?php echo htmlspecialchars($row['amount']); ?></td>
<td><?php echo htmlspecialchars($row['deliveredgift']); ?></td>
</tr>
<?php $counter++; $i++; }?>
</tbody>
</table>