Forum Moderators: not2easy

Message Too Old, No Replies

Printing in Landscape with CSS

Is it possible, and what browsers support it?

         

schyryll

5:45 am on Aug 27, 2003 (gmt 0)

10+ Year Member



How can I set the contents of my document to print in landscape format?

mirthe_v

8:26 am on Aug 27, 2003 (gmt 0)

10+ Year Member



Can't say I've tried, but I found the following through Google.

<style>
@PAGE landscape {size: LANDSCAPE;}
TABLE {PAGE: landscape;}
</style>

There's -as always- more info over at the W3C (http://www.w3.org/TR/2003/WD-css-print-20030813/)

Good luck

Mark_A

3:06 pm on Aug 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Wish I had seen this message about 2 months ago :-)

bondjamesbond

3:19 pm on Aug 27, 2003 (gmt 0)

10+ Year Member



Does this actually work in any broswers? I tried something similar in all the latest browsers and it did not work.

schyryll

1:37 am on Aug 28, 2003 (gmt 0)

10+ Year Member



so Mark_A you did had the same problem last 2 months ago? What did you use to make your report to print in lanscape format?

Guys, need your help and response...
Does this really work in browsers?

Thanks in advance!

mirthe_v

1:48 pm on Aug 28, 2003 (gmt 0)

10+ Year Member


Accidently stumbled upon a tutorial which covered this topic.
It says:

Before you get too much farther, you need to decide how big your printed page is going to be. This is actually a bit of a sticky spot, and you should make your decision based on what you think your audience is more likely to have. In general, it’s pretty safe to assume 8 ½”x 11” for North America, and A4 for Europe.

To set this size, insert the following into your style sheet:

BODY {
Size: 8.5in 11in;
}

This sets the maximum width and height of your body area to 8 ½ x 11. If you wish to force the orientation of the page, you can do so like this:

BODY {
Size: 8.5in 11in landscape;
}

Once you’ve set the page size, you’ll want to set up the page’s margins. Add a margin rule to the BODY style rule:

BODY {
Size: 8.5in 11in landscape;
Margin: 0.25in; }

This will place a quarter of an inch margin around your page’s content, which is usually more than enough for most printers. Play around with this value and change it as you see fit.

Source:
http://infocenter.cramsession.com/techlibrary/gethtml.asp?ID=1638