Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

print entire page

Status
Not open for further replies.

Pushkin

Programmer
May 28, 2002
22
0
0
BE
How can I make sure that I can print an entire page.
I can scroll to the right on the page, but when I print the page it only prints the left side.
Is it possible to print all what is on the form.

Thanks,

Pushkin
 
Pushkin,

If you use percentage values (i.e. 100%) instead of pixel widths for items on your page (tables, etc), then all should be fine.

Dan
 
You could create a print style sheet and have it force the width of the page contents to something that you deem printable.

If you had content in a div (for example) your print stylesheet might set the width of that block element to 600px when printing, but show it at 100% when not printing.

There are many examples on the net that explore this concept, and it may solve your problem.

Jeff
 
Thanks, but it's a really large table and it's set at 100%

I only get the first 5 columns or so
 
If there is physically too much data to print (sounds like this is the case), then you're going to have to instruct your printer to shrink the data to fit a page... Either (as Jeff suggested), you can use a print style sheet, and shrink the font down that way, or you could use the features that come with most printer drivers to "shrink to page", etc, when printing.

Hope this helps!

Dan
 
Dunno how exagerated the problem is but a lot can be done by specifying printer-friendly fonts and scaling the text down.

----------
I'm willing to trade custom scripts for... [see profile]
 
Like what was stated earlier, the easiest solutions might be to reduce your font size or to set the width of the table in a print style sheet. The only other option that I can think of that doesn't require the user to change their browser settings is to scale down your result table and that requires IE style filters.

This will resize the table to 75%:

<html>
<head>
<SCRIPT>
function fnResize(oObj,flMultiplier){
oObj.filters.item(0).M11 *= flMultiplier;
oObj.filters.item(0).M12 *= flMultiplier;
oObj.filters.item(0).M21 *= flMultiplier;
oObj.filters.item(0).M22 *= flMultiplier;
}
</SCRIPT>
</head>
<body onload=&quot;fnResize(document.getElementById('tbl'),0.75)&quot;>

<table id=&quot;tbl&quot; border=&quot;1&quot; STYLE=&quot;position:absolute;
filter:progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand')&quot;
width=&quot;300&quot;>
<tr>
<td>table 1</td>
</tr>
</table>
</body>

You can also use the &quot;zoom&quot; style available in later versions of Internet Explorer. The code is much simpler:

<table border=&quot;1&quot; STYLE=&quot;zoom:75%&quot; width=&quot;300&quot;>
<tr><td>table 2</td></tr>
</table>

After testing both, it appears that the &quot;zoom&quot; method is better for text and the first method I wrote about is better for images.

Other than that, maybe you can get creative with forced page breaks if you know where the table is going to be cut off. I haven't tried those though.

Adam
while(ignorance==true){perpetuate(violence,fear,hatred);life--};
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top