linque
asked on
printing cutting off at right
Is there some way to determine how a page will print for my visitors? I am working on a page that is cutting off some text at the right when printing. I do know I can change margins, or revamp the entire site, but I have been looking at other sites and I see that they are similarly constructed yet are not having the same issue. Perhaps (hoping) there is something I am overlooking. Otherwise I'm faced with lots of white space on the right or a total site revamp
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Untested at this moment, but you could try attaching this small script to a print button:
<script>
function myPrint()
{
document.body.margin-right ='100px';
window.print();
document.body.margin-right ='0px;
}
</script>
Make your button like
<input type="button" onClick="myPrint();" value="Print this page"></input>
or
<a href="javascript:void(myPr int());">P rint this page</a>
Don't have a printer at the moment so let me know if it worked.
<script>
function myPrint()
{
document.body.margin-right
window.print();
document.body.margin-right
}
</script>
Make your button like
<input type="button" onClick="myPrint();" value="Print this page"></input>
or
<a href="javascript:void(myPr
Don't have a printer at the moment so let me know if it worked.
I guess something like this:
Suppose you have a <div> that holds whatever you want printed, and let's say the <div> has an ID of "toPrint", then:
<style type="text/css">
@media print {
div#toPrint {margin-right:100px;}
}
</style>
@Havin_it:
Not sure, but shouldn't it be document.body.style.margin Right? Not sure, but pretty sure the hypens aren't supposed to be there ;)
Suppose you have a <div> that holds whatever you want printed, and let's say the <div> has an ID of "toPrint", then:
<style type="text/css">
@media print {
div#toPrint {margin-right:100px;}
}
</style>
@Havin_it:
Not sure, but shouldn't it be document.body.style.margin
ASKER
let's say I wanted the right margin to be 100pixels for printing purposes only.. would you mind showing me the syntax for that please?