Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q506 Is there any way to force page breaks on a printer that is printing HTML from a browser?

irt.org | Knowledge Base | JavaScript | Print | Q506 [ previous next ]

Q506 Is there any way to force page breaks on a printer that is printing HTML from a browser?

Edward E. Hacker writes:

Internet Explorer supports a Style to force a page break on printing. I have seen this work using the DIV tags. For example:

<div style="page-break-before:always">
stuff on a new page
</div>

The following was submitted by Deepak Borule

Yes and No. Yes we can but it is IE specific and cannot be used with Netscape. We can do with style tag and a recognition point from which the page should break.

<html>
<head>
<title>Sample Printing</title>
<style>P.page{page-break-after: always}</style>
</head>
<body>
<p class=page>
this is a page printing sample.after the end of 
this p tag printing will start from next page.
</p>
<p class=page>
See it will print the data from next page.
Here we will give a button using that button 
we will print this document.
<br>
<input type=button name=printit value='Print Me' onClick='print();'>
</p>
</body>
</html>

Feedback on 'Q506 Is there any way to force page breaks on a printer that is printing HTML from a browser?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb and Michel Plungjan
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.