Solved

Page break, but only on printed docs??

Posted on 1998-12-20
3
122 Views
Last Modified: 2010-04-09
Is it possible to tell where in a web-page it should
be a page-break, bun only only when the client print it?
If it is....which Tag or something else do the trick?

0
Comment
Question by:erot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 4

Expert Comment

by:rafistern
ID: 1840856
You can do this in IE4. This is what my help file says about it:

These Style Sheet printing extensions are aimed at documents that will use the <STYLE MEDIA="print"...> style sheet setting, specifying the style sheet as being suitable for printed documents. Note that the printing extensions are only a recent addition to Style Sheets and are claimed to be supported by Internet Explorer 4.0.

page-break-after
Value: auto | always | left | right
Initial: auto
Applies to: block-level elements outside of tables
Inherited: no
Percentage values: N/A

The values are:

auto
do a page break after the element only if necessary (e.g. if there is no remaining space on the current page)
always
always do a page break after the element
left
do one or two page breaks after the element until a blank left page is reached
right
do one or two page breaks after the element until a blank right page is reached
As an example, a hard page break may be inserted in the document with the BR tag as follows:

<STYLE>
BR.page { page-break-after: always }
</STYLE>
.
<BR CLASS=page>
.
If there are conflicts between this property and the 'page-break-before' value on the previous element (as formatted on the canvas), the value that results in the largest number of page breaks will be used.

Note: a way to suppress page breaks after an element is currently under discussion by the W3C, but the syntax is not yet defined.

page-break-before
Value: auto | always | left | right
Initial: auto
Applies to: block-level elements outside of tables
Inherited: no
Percentage values: N/A

The values are:

auto
do a page break before the element only if necessary (e.g. if there is no remaining space on the current page)
always
always do a page break before the element
left
do one or two page breaks before the element until a blank left page is reached
right
do one or two page breaks before the element until a blank right page is reached
As an example, a page break may be inserted in the document before all H1 elements:

<STYLE>
H1 { page-break-before: always }
</STYLE>
.
<H1 CLASS=chapter>
.
If there are conflicts between this property and the 'page-break-after' value on the next element (as formatted on the canvas), the value that results in the largest number of page breaks will be used.



Try and see if it works.
0
 
LVL 6

Expert Comment

by:PBall
ID: 1840857
I've answered this question before (look for Page Break in MSIE 4.0 - 11/04/98).  And no BR does not support that style sheet property.

You can use P tag instead.
0
 
LVL 8

Accepted Solution

by:
jhurst earned 50 total points
ID: 1840858
you will not like this answer:

The answer is NO - it is not possible!

This is probably the most asked question here and in newsgroups - this is why I can be so certain in my response.

I myself have asked it.

There are various documented features of CSS that should do this.  None of them work.  

There are some tricks that you can do.  One of the browsers does not like to split images accross page boundaries, the other tries to keep tables on one page.  So by embedding text in a table and including a tranparent long gif you can sort of force page breaks by preventing them.  It is by no means fool-proof but with experimentation works for MSIE and NN 3 and 4.


0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question