•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JavaScript / DHTML / AJAX section within the Web Development category of DaniWeb, a massive community of 331,735 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,166 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JavaScript / DHTML / AJAX advertiser: Lunarpages Web Hosting
Views: 72590 | Replies: 24
![]() |
•
•
Join Date: Aug 2004
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
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.
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.
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,789
Reputation:
Rep Power: 32
Solved Threads: 105
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.
Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
•
•
•
•
Originally Posted by cscgal
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.
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.
•
•
Join Date: Feb 2002
Location: Lawn Guylen, NY
Posts: 10,789
Reputation:
Rep Power: 32
Solved Threads: 105
Oh I see what you're saying. Use JavaScript to load the print dialog box. Gotcha there
Dani the Computer Science Gal
Do you run a computer-related website? Feature it in our niche link directory!
Do you run a computer-related website? Feature it in our niche link directory!
•
•
Join Date: Feb 2005
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
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>
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>
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Marketplace (Sponsored Links)
- Previous Thread: Remove URL from Bottom of Printed Web Page
- Next Thread: Right Align Option Element Text



Linear Mode