Printing question

liunx

Guest
Is there any way to put page breaks in my html or javascript so that I can at control when where pages start? I am looking to print a calendar (variable size days) where each month is a table. Any suggestions would be greatly appreciated!<!--content-->Why not just put <br> in your tag? Those ARE line breaks. Or so I would think.<!--content--><br> stands for break, so yeah, it is line break. of course, he must need something more techinical becuase *gulp* everyone knows that, right?:confused:<!--content--><br> is a line break. He wants to control the page breaks when printing.<br />
<br />
Unfortunately, I have never seen any method of doing this. The best I have seen is to create printer friendly CSS (<!-- m --><a class="postlink" href="http://www.javascriptkit.com/dhtmltutors/cssmedia.shtml">http://www.javascriptkit.com/dhtmltutors/cssmedia.shtml</a><!-- m -->).<!--content-->Ok, I found the answer by searching other posts in this forum. Just in case anyone was wondering, one may use CSS:<br />
<br />
<html><br />
<head><br />
<title>page breaks</title><br />
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><br />
<style><br />
.newPage { page-break-before: always }<br />
</style><br />
</head><br />
<body><br />
Page 1<br />
<div class="newPage"> <img src=http://www.htmlforums.com/archive/index.php/"blank.png"> </div><br />
Page 2<br />
</body><br />
</html><br />
<br />
blank.png can be any graphic. I used a 1 pixel png file for proof of concept. Then, "<div class="newPage"> <img src=http://www.htmlforums.com/archive/index.php/"blank.png"> </div>" starts a new page and displays the graphic. On screen, they are directly under one another, but if you do a file->print you will get 2 pages.<!--content-->i don't undestand the reason for the image but hey, as long as it works, remember to close your css values { page-break-before: always ; }<br />
Here's (<!-- m --><a class="postlink" href="http://www.cybertext.com.au/tips_HTML_pagebreak.htm">http://www.cybertext.com.au/tips_HTML_pagebreak.htm</a><!-- m -->) a few more ways to insert page breaks :)<!--content-->Hmm, you're right, it doesn't need the image. It was just done like that in the example I saw. <br />
<br />
<div class="newPage"> </div><br />
<br />
works just fine!<!--content-->
 
Back
Top