![]() |
| ||
| How to set landscape orientation? Hi Guys, I m writing one HTML page where i wanted the page orientation to be set to LANDSCAPE through Javascript or CSS. So when I click on Print button or anyways on the HTML page, the print window will pop-up so now in that orientation property should be set to LANDSCAPE. So does anyone know how to accomplish this? Thanks in advance. |
| ||
| Re: How to set landscape orientation? |
| ||
| Re: How to set landscape orientation? I'm confused how one can set the page orientation of a website. One can simply stretch a browser window to any shape and size they want and if relative values are used for tables and such, the text will stretch along with the window. |
| ||
| Re: How to set landscape orientation? Quote:
Dani, You can apply CSS style rules to create a custom-sized print box. What you cannot do is force the Print Dialog box to default to landscape. CSS and/or JavaScript cannot reach into the system resources. |
| ||
| Re: How to set landscape orientation? Oh I see what you're saying. Use JavaScript to load the print dialog box. Gotcha there ;) |
| ||
| Re: How to set landscape orientation? No, not quite. The CSS specification allows you to set styles that come into play when the user Prints. So the site may display one way, but when you print, certain elements will be excluded, etc. |
| ||
| Re: How to set landscape orientation? The CSS for this is simple (just use class="landscape"): <style type="text/css" media="print"> @page port {size: portrait;} @page land {size: landscape;} .portrait {page: port;} .landscape {page: land;} </style> So there. |
| ||
| Re: How to set landscape orientation? scandal_uk, I am trying to test out your CSS code for Landscape Orientation but I cannot seem to be able to make it work. I have created a test page with the following code. What am I doing wrong? <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css" media="print"> @page port {size: portrait;} @page land {size: landscape;} .portrait {page: port;} .landscape {page: land;} </style> </head> <body class="landscape"> <table width="95%" border="0" class="landscape"> <tr class="landscape"> <td class="landscape">1</td> <td class="landscape">2</td> <td class="landscape">3</td> <td class="landscape">4</td> <td class="landscape">5</td> <td class="landscape">6</td> <td class="landscape">7</td> <td class="landscape">8</td> <td class="landscape">9</td> <td class="landscape">10</td> <td class="landscape">11</td> <td class="landscape">12</td> <td class="landscape">13</td> <td class="landscape">14</td> <td class="landscape">15</td> <td class="landscape">16</td> <td class="landscape">17</td> <td class="landscape">18</td> </tr> </table> </body> </html> |
| ||
| Re: How to set landscape orientation? I have been attempting the same CSS implementation, but I read in a book today that Opera 6/7 is the only browser which supports the property which sets the orientation. :sad: |
| ||
| Re: How to set landscape orientation? Hi vivekgalatage, Did you find a way to do this?. thanks.... |
| All times are GMT -4. The time now is 11:42 pm. |
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC