Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 553
  • Last Modified:

Problem with table printing in Firefox

I am using JSTL with a foreach tag to create table content.
When printing out pages with really long tables in firefox, the browser doesnt seem to split the table up on multiple pages. It only prints out as much as it can on 1 page, and the rest is lost.
0
Sjonninn
Asked:
Sjonninn
  • 13
  • 8
  • 3
  • +1
1 Solution
 
ellandrdCommented:
Does this happen in any other browser?
0
 
SjonninnAuthor Commented:
I tried this on safari, and it seems to print out correctly there.

I read somewhere that firefox sometimes has a problem generating page-breaks, but there was no solution to it.
0
 
ellandrdCommented:
I also would have expected for the table contents to be continued onto the next page... and as i thought it has worked fine for me.  i just create a test HTML page with a long table and printed it from Firefox (2.0.0.6) and it was fine - the table contents continued onto the next page...

What version of Firefox are you on??

I have a quick look around the mozillaZone forums and found this:

http://forums.mozillazine.org/viewtopic.php?p=2775285&sid=7588efe123babcd7a7395cc0fde0a636

It might help you fix your issue...

ellandrd
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
SjonninnAuthor Commented:
ellandrd
After reading through the link you provided, I gather that the problem is with the DIV that contains the table. The table is set up so the header does not scroll, so a div container was neccesary.

But unfortunately, I could not find any suggestions on how to solve this. Seems that Firefox sometimes has problems with DIVs that spread over many pages.
0
 
ellandrdCommented:
ah - i have no div in my text... 2 mins...
0
 
ellandrdCommented:
It seems that firefox shrinks the contents to fit on 1 page.

this could be a bug - im not sure...  i have also tested this in IE7 and safari and they are both fine...
0
 
ellandrdCommented:
when you print preview in firefox, does it shrink to 1 page too??
0
 
SjonninnAuthor Commented:
yes, I get the same result when I print preview.
0
 
ellandrdCommented:
So do i - but i was just checking... i honestly think that this is a printing bug within firefox that occurs when you have elements wrapped in divs.

maybe we can come up with an alternative way - can you just have menu in its own div that doesnt scroll and leave the table as it is without wrapped in a div?
0
 
Marc ZCommented:
What happens when you go to File->Page Setup and

Uncheck the
Shrink to Fit option under the Format and Options tab?

Have you tried that?
0
 
SjonninnAuthor Commented:
ellandrd

The width of the table cells is generated from the content of the table, and since the content is generated from JSTL, the width differs from time to time. Therefor I have to have the header attached to the table body, so the headers will follow the td widht.

mtz1of4

Nothing seems to change if I try to change the page setup
0
 
ellandrdCommented:
playing with the page setup will not fix this issue - the issue is caused by the DIV tag.

mtz1of4 try it for your self - create a page with a table that has alot of content - it seems to print fine (it did for me), but as soon as you wrap a div around it, it wont print fine.
0
 
ellandrdCommented:
not a solution but to me this looks like we're going nowhere if you have to keep what you've got and cant change it.. :-(

ellandrd
0
 
SjonninnAuthor Commented:
yeah, that´s what I was afraid of :(
The customer wanted this application to be made exclusively for firefox, so I guess I have to work something out.

Thanks for your help anyway!
0
 
ellandrdCommented:
why just firefox?? that is madness...  your customer cannot expect everybody to use firefox although the number of users swicthing to it from IE is increasing you cant force all your user to it - you should have explained this to him/her...

ellandrd
0
 
SjonninnAuthor Commented:
The system I am building is merely a console, which only a handful of employees will use :)
The front end, ofcourse, will be adapted for all browsers.
0
 
ellandrdCommented:
and so you want this handful of staff to have nice printed output of the page - i'd stick to plain black and white then... forget styling...
0
 
ellandrdCommented:
mtz1of4

that was already mentioned above
0
 
SjonninnAuthor Commented:
ellandrd

is it possible for me to simply disable all styles when @media print{} ?
That would certainly be a solution.
The pages must follow a certain style guide on the screen, so there are alot of div classes involved, but when printing it would be enought to simply print out the full table without any styling
0
 
Marc ZCommented:
Sorry, you guys are fast.

How about this one?
https://bugzilla.mozilla.org/show_bug.cgi?id=369602#c3

0
 
ellandrdCommented:
yes - you would use:

<link rel="stylesheet" type="text/css" href="" media="print">

ellandrd
0
 
Eternal_StudentCommented:
You can hide anything in that stylesheet that you do not wish to print by doing the following:

#navigation .etc {
display: none !important;
}
0
 
Eternal_StudentCommented:
If you want to leave some basic styles that is.
0
 
SjonninnAuthor Commented:
I´ve decided to make a separate style sheet for printing, and set all other style sheets to media="screen". Since there are over a thousand classes to go through, I think this is the best solution.
0
 
ellandrdCommented:
OK.  anyways thanks for the grade - sorry i wasn't of more help to get a A...

ellandrd
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 13
  • 8
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now