HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming
Receive the tools necessary to be the rock star of your field. Our 12-month program teaches you the evolving world of multi-channel marketing as well as the complex issues and opportunities found in the industry.

ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month!
Download and Activate to enter!

Web development can be a daunting task, even for specialists. There is a lot of information to absorb and a lot of technologies to learn in order to manage a superior website. When trying to learn the ropes, developers need a reliable source to introduce new ideas that can be easily implemented. When working on large projects, even web veterans may run into a technology or an aspect of a technology that they are unfamiliar with.

Learn More!


Download to Enter
| Contest Rules

Tutorials | Forums

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old April 16th, 2011, 09:11 AM
jasonc310771 jasonc310771 is offline
Contributing User
Click here for more information.
 
Join Date: Jun 2005
Posts: 540 jasonc310771 User rank is Private First Class (20 - 50 Reputation Level)jasonc310771 User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 6 Days 15 h 18 m 36 sec
Reputation Power: 7
How do i insert a page break in to my webpage

I wish to break up the page for printing purposes, i have three or 4 parts on my page and without having to add a lot of blank lines I wish to allow them to click the print button and have it print each section on a seperate page.

how would i go about doing this ?

Reply With Quote
  #2  
Old April 16th, 2011, 10:00 AM
AndrewSW's Avatar
AndrewSW AndrewSW is offline
JavaScript is not spelt java
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2011
Location: Landan, England
Posts: 479 AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 23 h 50 m 34 sec
Reputation Power: 94
The simplest approach would be to put the separate parts within iframes. So when your users see the print dialog they can choose to print the current frame. (FireFox has an obtain to print 'Each frame separately'.)

You would need to split your, say, four sections into four separate .html pages. Then on the main page insert (and size and position) your iframes and set the src for each of them to one of your four new pages.

Reply With Quote
  #3  
Old April 16th, 2011, 10:13 AM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Moderator
Click here for more information.
 
Join Date: Dec 2004
Posts: 6,457 E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 1 Month 2 Weeks 4 Days 2 h 12 m 3 sec
Reputation Power: 6144
CSS has a page break property:
http://www.javascriptkit.com/dhtmlt...pagebreak.shtml

Generally though, if you want a lot of control over how something looks when it's printed you should use PDF.
__________________
How to program a basic, secure login system using PHP

Quote:
Originally Posted by Spad
Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

Reply With Quote
  #4  
Old April 16th, 2011, 10:25 AM
AndrewSW's Avatar
AndrewSW AndrewSW is offline
JavaScript is not spelt java
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2011
Location: Landan, England
Posts: 479 AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level)AndrewSW User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 2 Days 23 h 50 m 34 sec
Reputation Power: 94
Quote:
CSS has a page break property:
http://www.javascriptkit.com/dhtmlt...pagebreak.shtml

E-Oreo: Thank you, I had forgotten about this. (When I first studied css a few years ago it wasn't well supported.)

When you recommend PDF do you mean - provide a link to a separate pdf document? I know it's possible for JavaScript to create a pdf, but it's not the simplest thing to take on.

Thanks, Andy.

Reply With Quote
  #5  
Old April 16th, 2011, 10:24 PM
E-Oreo's Avatar
E-Oreo E-Oreo is offline
Moderator
Click here for more information.
 
Join Date: Dec 2004
Posts: 6,457 E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)E-Oreo User rank is General 77th Grade (Above 100000 Reputation Level)  Folding Points: 945 Folding Title: Novice Folder
Time spent in forums: 1 Month 2 Weeks 4 Days 2 h 12 m 3 sec
Reputation Power: 6144
Quote:
Originally Posted by AndrewSW
When you recommend PDF do you mean - provide a link to a separate pdf document? I know it's possible for JavaScript to create a pdf, but it's not the simplest thing to take on.

Yes, a link to a PDF document. It's not possible to generate a dynamic PDF document with client side JavaScript, but you can do it with a server side language.

Reply With Quote
  #6  
Old May 10th, 2011, 10:36 AM
lvwd lvwd is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2011
Posts: 7 lvwd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 29 m 37 sec
Reputation Power: 0
I like divs when separating content

Reply With Quote
  #7  
Old November 9th, 2011, 12:44 AM
cashloan cashloan is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2011
Posts: 46 cashloan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 51 m 59 sec
Warnings Level: 10
Number of bans: 2
Reputation Power: 1
thanks to cascading style sheets, it is possible to give modern web browsers a "hint" to help them put page breaks in the right places when printing out web pages. Here is an example:

<p style="page-break-before: always">

This will force a page break when printing, before the start of this particular <p> element.

Reply With Quote
  #8  
Old January 12th, 2012, 03:23 AM
bryanbell bryanbell is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2010
Posts: 53 bryanbell User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 h 17 m 14 sec
Reputation Power: 2
You can simply add &ltP style="page-break-before: always"> before the starting of the new page. For i.e.

<html>
<body>

This is the text for page #1.

<p style="page-break-before: always">

Page #2...

<p style="page-break-before: always">

Page #3...

</body>
</html>

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > How do i insert a page break in to my webpage


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 7 - Follow our Sitemap