Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Creating Page Breaks in an HTML Document

Posted on 1999-01-28
4
Medium Priority
?
160 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 150 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: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
Q&A with Course Creator, Mark Lassoff, on the importance of HTML5 in the career of a modern-day developer.
In this tutorial viewers will learn how to embed an audio file in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: : The declaration should display (CODE) HTML5 is supported by the most recent versions of all major browsers…
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

885 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