Below is my code for display data on print preview..
In this table i need to repeat header on every page.
I need to print only 10 rows in each page..After that need page break and display Data data on next page With repeating header...
Now my prob. is my code repeat header after 10 rows but i cannot understand how to break page after 10 rows and header display on next page...not in middle of the page...
plz help me..
<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>