Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Printing CSS and Page Breaks

Tags:

css

printing

I want to insert a page break when users print my web page.

IE 7, Mozilla 3.0 , any Chrome

like image 559
user326096 Avatar asked Feb 25 '23 09:02

user326096


1 Answers

You can use the CSS page-break-before or page-break-after properties in a print media style sheet to achieve this.

For example:

<style>
    @media print {
        table {
            page-break-after: always;
        }
    }
</style>
like image 200
John Parker Avatar answered Mar 08 '23 05:03

John Parker