Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using CSS to default print style to landscape  RSS feed

 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to print a page of a web application and, because this page includes some rather wide tables, I'd like to use CSS to default the page to print in a landscape format, rather than requiring the users to change it every time they want to print.

I found some documentation online and, as best I can tell, adding this to my CSS file:



should do the trick. Unfortunately, it doesn't. When I bring up the Print Preview window, I still get the portrait view. What am I doing wrong? Anyone know how to accomplish this?

Thanks,
Corey
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the only browser that supports that is Opera.

Eric
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Eric Pascarello:
I think the only browser that supports that is Opera.


Hmmm...bummer. So any solution this this problem in IE? Or does the user simply have to select Landscape any time he/she wants to print?
 
Garann Means
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are ActiveX objects you can get that fiddle with the default print settings. So if IE's your only concern, those work.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!