Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Creating Page Breaks in an HTML Document

Posted on 1999-01-28
4
Medium Priority
?
159 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

704 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