And what, pray tell, is a "page break"???
It's a meaningless concept in HTML, where a "page" can be 30 pixels high or 30,000 pixels high.
So I have to assume you mean a page break that occurs only when printing the HTML page, no??
And the generic answer to that is pretty easy:
First, you can have STYLEs that are specific to ONLY the printed version of a page. So, for example, this pair of styles I have on one of my pages. The font size changes for the printed version and many elements (e.g., <FORM> fields) are removed in the printed version:
Code:
<STYLE>
@media SCREEN {
BODY { font-size: 12pt; }
TD { font-size: 12pt; }
.screenonly { display: inline }
INPUT { font-size: 10pt; width: 78; }
INPUT.mem { font-size: 10pt; background-color: pink; width: 78; }
TABLE { width: 980; }
H5 { display: none; }
}
@media PRINT {
BODY { font-size: 8pt; }
TD { font-size: 8pt; }
.screenonly { display: none }
INPUT { visibility: hidden; font-size: 8pt; width: 60; }
INPUT.mem { visibility: visible; background-color: pink; font-size: 8pt; width: 60; }
TABLE { width: 900; }
H5 { page-break-before: always; font-family: arial, sans-serif; font-size: 10pt; }
}
</STYLE>
So in my HTML I can always use something like
<span class="screenonly">xxxx</span> to suppress "xxxx" on the printed version. And then I can use
<h5>page 2</h5> where I want a page break in the printed version but it won't appear at all in the screen version.
NOW...what do you do about content that varies in size??? That is, if you are dumping (say) text to a <DIV> and the text might be of various sizes or content or contain embedded stuff? How can you calculate where the page break should be?? That's a lot tougher and is somewhat browser-dependent. The above technique works best when you are able to tightly control the size of your content.