Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
07-27-2002, 05:48 AM #1
- Join Date
- Jul 2002
- Thanked 0 Times in 0 Posts
printing form with header/footer included on each page
I have 1 huge form...I can't cause a page bread inside of the form...I tried to use the following code but it did not work...keeps pushing the header before the form...how can I control page breaks within the form for printing purposes?
Specifying page breaks for printing using CSS
With CSS (level 2), the grip webmasters have over their webpages extends to the printer. To satisfy the controlling tendencies within us, IE5 and NS6 give you the power to insert artificial page breaks for printing. Now your site can look the way you want it to even after the computer's turned off!
page-break-before and page-break-after
Here are your two boys for getting the job done- the CSS attributes page-break-before and page-break-after. Both instruct the printer to begin printing a new page, with the difference being before or following the element the attribute is applied to. The possible values the two attributes accept are:
always Always insert a page break
auto Default value. Insert page break only if at end of page.
"" (empty string) Do not insert a page break.
Let's say your page consists of multiple headers (with content following each). Want to divide each header into a separate page for printing?
How about getting even more personal, and divvying things up at specific location(s)?
Note that page-break-after may not work with <BR> or <HR> tag in some browsers.
Their scripting equivalents- pageBreakBefore and pageBreakAfter
<input type="checkbox" name="mybox" onClick="breakeveryheader()">
var thestyle=(document.forms.myform.mybox.checked)? "always" : "auto"
for (i=0; i<document.getElementsByTagName("H2").length; i++)