471,319 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

Browsers not breaking pages on print

Trying to print a web page that scrolls to right a bit. I would think
IE would page break by default when it gets to the end of the sheet,
but it doesn't, it just cuts off the print. This only needs to work
in IE but FF does the same thing. I tried messing with some
media="print" functionality on it but couldn't get any page breaks to
happen. I'm guessing there's something in the markup of the page that
the browsers don't like, any idea what I should look for? Thanks.
Nov 21 '07 #1
9 2651
On Wed, 21 Nov 2007, xprotocol wrote:
Trying to print a web page that scrolls to right a bit.
Your own page? Which address (URL)?

--
Top-posting.
What's the most irritating thing on Usenet?
Nov 21 '07 #2
xprotocol wrote:
Trying to print a web page that scrolls to right a bit. I would think
IE would page break by default when it gets to the end of the sheet,
but it doesn't, it just cuts off the print. This only needs to work
in IE but FF does the same thing. I tried messing with some
media="print" functionality on it but couldn't get any page breaks to
happen. I'm guessing there's something in the markup of the page that
the browsers don't like, any idea what I should look for? Thanks.
You mean you expect the browser to do what Excel does with a wide
spreadsheet, treating the presentation as though it's multiple pages
across as well as down? It won't. It's up to you to structure your page
so that its layout adjusts to fit the width of whatever medium is being
used to display it.
Nov 21 '07 #3
On 2007-11-21, Harlan Messinger wrote:
xprotocol wrote:
>Trying to print a web page that scrolls to right a bit. I would think
IE would page break by default when it gets to the end of the sheet,
but it doesn't, it just cuts off the print. This only needs to work
in IE but FF does the same thing. I tried messing with some
media="print" functionality on it but couldn't get any page breaks to
happen. I'm guessing there's something in the markup of the page that
the browsers don't like, any idea what I should look for? Thanks.

You mean you expect the browser to do what Excel does with a wide
spreadsheet, treating the presentation as though it's multiple pages
across as well as down? It won't. It's up to you to structure your page
so that its layout adjusts to fit the width of whatever medium is being
used to display it.
I think you have that backwards. :)

"It's up to you to not to structure your page so that its layout
doesn't adjust to fit the width of whatever medium is being used
to display it."

By default, a page will adjust; if it doesn't, its because you have
done something to prevent it.

--
Chris F.A. Johnson <http://cfaj.freeshell.org>
================================================== =================
Author:
Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
Nov 21 '07 #4
"Chris F.A. Johnson" <cf********@gmail.comwrites:
On 2007-11-21, Harlan Messinger wrote:
You mean you expect the browser to do what Excel does with a wide
spreadsheet, treating the presentation as though it's multiple pages
across as well as down? It won't. It's up to you to structure your page
so that its layout adjusts to fit the width of whatever medium is being
used to display it.

By default, a page will adjust; if it doesn't, its because you have
done something to prevent it.
For example, adding content with an unavoidably large intrinsic
width. Data tables can reasonably have several columns each containing
long(ish) words or numbers that constrain their minimum width. Only
being able to print off the left half (quarter, tenth) of a complex
data table *is* a browser bug. In most other display media, in this
situation, you'll get a scroll-bar and be able to read the table. Not
the most user-friendly interface, but you can at least get at the
data. In print, where a scroll-bar is impossible, why *shouldn't* the
browser print (at least as an option!) multiple pages horizontally?

--
Chris
Nov 21 '07 #5
Chris Morris wrote:
"Chris F.A. Johnson" <cf********@gmail.comwrites:
>On 2007-11-21, Harlan Messinger wrote:
>>You mean you expect the browser to do what Excel does with a wide
spreadsheet, treating the presentation as though it's multiple pages
across as well as down? It won't. It's up to you to structure your page
so that its layout adjusts to fit the width of whatever medium is being
used to display it.
By default, a page will adjust; if it doesn't, its because you have
done something to prevent it.

For example, adding content with an unavoidably large intrinsic
width. Data tables can reasonably have several columns each containing
long(ish) words or numbers that constrain their minimum width. Only
being able to print off the left half (quarter, tenth) of a complex
data table *is* a browser bug.
No it isn't. It may be the lack of a *useful feature*, but that's a
topic for a different discussion, and I would dispute it. If you've got
a web page consisting of text that insists on being wide enough to
overflow the right margin of a piece of paper, then should it split the
content along a straight vertical line, slicing right through characters
and images as it goes? If the web page is 500 lines long, equivalent to
maybe 20 sheets of paper when there *isn't* a horizontal overflow, and
only one paragraph, or perhaps a short table or an image, overflows the
right margin, then when you print the page should the printer, in
addition to 20 sheets containing the left side of the content, spit out
19 blank pages as well as the 20th that has the right side of the
overflowing material on it? Or 38 blank pages as well as the 39th and
40th if the overflow is itself more than one page wide?

In most other display media, in this
situation, you'll get a scroll-bar and be able to read the table. Not
the most user-friendly interface, but you can at least get at the
data. In print, where a scroll-bar is impossible, why *shouldn't* the
browser print (at least as an option!) multiple pages horizontally?
Nov 21 '07 #6
xprotocol wrote:
Sorry, its hard to be specific as the HTML source is rather complex
and probably wouln't make things much easier to understand if I posted
it.
For heaven sake no! Don't post code, post a URL to the code!
The easiest explanation I can say is that somewhere in the source
I have two large SPAN's. For one of them I said "page-break-
after:always;" but nothing happened.
SPANs? SPANs are *inline* elements page-break-before & page-break-after
properties that apply to *block* elements so I am not surprised that it
does not work.
I guess what I'm looking for is
maybe an explanation or a site that says what the rules are for using
these printing features. Everything Google came up with was very
basic (i.e. put this in and you magically get a page break, obviously
not the case).

--
Take care,

Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Nov 22 '07 #7
rf

"xprotocol" <xp*******@gmail.comwrote in message
news:8c**********************************@r31g2000 hsg.googlegroups.com...
Sorry, its hard to be specific as the HTML source is rather complex
and probably wouln't make things much easier to understand if I posted
it. The easiest explanation I can say is that somewhere in the source
I have two large SPAN's. For one of them I said "page-break-
after:always;" but nothing happened.
According to the spec over at http://www.w3.org/TR/CSS21/propidx.html
page-break-after (and all the other page-break things) only apply to block
level elements. Span is an inline element.
I guess what I'm looking for is
maybe an explanation or a site that says what the rules are for using
these printing features. Everything Google came up with was very
basic (i.e. put this in and you magically get a page break, obviously
not the case).
See above.

--
Richard
Nov 22 '07 #8
CJ
I have a similar problem with a page of mine. I have a div that
contains two spans that each contains a table. The table in the left
side div is just a description of activity for a person, while the
table in the right side span has 24 columns, and has small graphics
showing the length of time spent on that activity for a day. The
problem is that the activity description can be pretty long (300 px),
and the graphics for the day add up to make the length of the right
side span pretty long too (~500 px). IE creates a scroll bar at the
bottom of the page, but if I go into print preview, I only see the
description, and maybe 3 hours on a single page. The rest of the
hours just disappear and I can't see them at all.
I have tried adding
<style type="text/css">
SPAN {display:block;}
</style>
<style type="text/css" media="print">
DIV {position:relative;}
SPAN {position:relative;}
</style>
to display SPANs as blocks since one google search implied that could
have been an issue, while another search implied position:absolute
could have also caused an issue.

I don't have this on the open internet because this is for my dad to
use, so I'm leaving it purely intranet
Nov 23 '07 #9
CJ wrote:
I have a div that contains two spans that each contains a table.
You can't put <tableinside a <span>. Maybe your problem will go away
if you have valid markup.

See: http://validator.w3.org/

--
-bts
-Motorcycles defy gravity; cars just suck
Nov 23 '07 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by confused | last post: by
133 posts views Thread by Alan Silver | last post: by
4 posts views Thread by m.shidoshi | last post: by
13 posts views Thread by Alan Silver | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.