Solved

Creating Page Breaks in an HTML Document

Posted on 1999-01-28
4
157 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
[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
  • 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Find out what you should include to make the best professional email signature for your organization.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

739 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