Solved

Creating Page Breaks in an HTML Document

Posted on 1999-01-28
4
154 Views
Last Modified: 2010-04-09
Is there a way to put page breaks in an html document so that you can control how much is printed out on each page?
0
Comment
Question by:kch011099
  • 2
4 Comments
 
LVL 6

Expert Comment

by:PBall
ID: 1845773
This is like what.... the 3rd or 4th time this question pop up.
This is in the paq (now if only these people at expert exchange will implement their disfunctional search stupid thingy) ugh.

Anyway, do this:

<style>
break {
  page-break-after:always
}
</style>

:
:

This is the old page
<p class=break></p>
This is a new page.
<p class=break></p>
This is another new page.

This will work in IE4, don't count on it on Netscape unless anyone else has tried it.

Now you can remove this question...
0
 

Author Comment

by:kch011099
ID: 1845774
I need this to work in both Explorer and Netscape.
0
 
LVL 6

Expert Comment

by:PBall
ID: 1845775
Good luck :)
0
 
LVL 8

Accepted Solution

by:
jhurst earned 50 total points
ID: 1845776
As was said, this is a very commom question.  The fact is that despite what the documentation says there is no method in html that works.

However, there is a kludge that you can use and does work.

One of the browsers will always attempt to keep a table on the same page, the other will do the same with an image.  SO you place the entire text that you want on a page as a single element of a one row table, you also include a transparent gif that is as long as the page in the second column of the table.

Now when the browser attempts to keep the table on a page, or the image, you get what you want.  

We have been using this method for a year now in literally thousands of sites and it works well with NN and MSIE 3 and 4.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Alert not firing 2 34
2 CSS questions 11 36
Image not there 4 35
Urgent Help with HTML CSS Positioning 9 22
Do you want to insert HTML5 video into your site? This is the tutorial how to do so. What are the main advantages of HTML5 video? 1) Have good compression, good image quality, and low decode processor use. 2) It is royalty-free 3) It is easi…
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…
In this tutorial viewers will learn how to position overlapping items using z-index in CSS. They will also learn the restrictions on the z-index property.  Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Red.…

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now