0

I have a invoice with a header(company name,address,invoice number) and footer(authorized signature and sum total)
and rows and i want that after printing 8th row next row will go next page(forcefully) with the header and footer. How do i achieve this.

I have used page-break-after: always but that not working in print preview of chrome

@media print {

    .page1 { page-break-after: always !important; }
    }
<table>
    <thead> 
    <tr> 
        <th>Sl</th> 
        <th>description</th>        
        <th>quantity</th>
        <th>UOM</th>
        <th>price</th> 
        <th>Amount</th> 
        <th>&nbsp;</th>
    </tr>
    </thead>
    <tbody style="border:1px solid #ccc; font-size:9px;">
     $r = 1; foreach ($rows as $row):
            <tr class="<?php echo ($r==8)?'page1':''?>">

                <td style="text-align:center; width:40px; vertical-align:middle;"><?php echo $r; ?></td>

                <td style="vertical-align:middle;"><?php echo $row->product_name; ?>
                <td style="width: 70px; text-align:center; vertical-align:middle;"><?php echo $row->quantity; ?></td>

                <td style="width: 70px; text-align:center; vertical-align:middle;"><?php echo $row->uom; ?></td>

                <td style="width: 80px; text-align:right; padding-right:10px; vertical-align:middle;"><?php echo $this->ion_auth->formatMoney($row->unit_price); ?></td>



                <td style="width: 100px; text-align:right; padding-right:10px; vertical-align:middle;"><?php echo $this->ion_auth->formatMoney($row->gross_total); ?></td> 

                <td>&nbsp;</td>

            </tr>





    <?php 

        $r++; 

        endforeach;

    ?>

    </tbody> 
    </table>

0 Answers0