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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page Headers & Footers

Status
Not open for further replies.

arpan

Programmer
Oct 16, 2002
336
IN
I am using the following CSS to print web pages that display the pay-slip of all the employees in a firm:

<style media=&quot;screen&quot;>
div{
display:none;
}
div{
display:none;
}
</style>
<style media=&quot;print&quot;>
div{
display:block;
}
div{
display:block;
}
h3{
page-break-before:always
}
</style>

Internet Explorer 6.0 gives an option on Page Setup when the 'File' menu is clicked where there are 2 boxes in which one can specify the header & the footer where certain symbols are used (by IE) for denoting the headers & the footers. For eg. &u will print the URL on each page, &d will print the date on each page, &t will print the time on each page etc.. Also if anyone is using the Page Setup for the 1st time, he will already find some default symbols there. Since I guess many people are not aware of the presence of these symbols when the Page Setup is clicked, if they issue the Print command, they find that the URL of that web page or the current date or the current time gets printed as well which they don't want. Is there someway by which I can ensure that, even if the default symbols are present (say &u in the footer texbox which will print the URL at the bottom), the presence of these symbols will not print the unnecessary text by using a JavaScript function i.e. as per the &u example, the URL of the web page will not be printed in each & every page? Also can the top-margin, bottom-margin, left-margin & the right-margin be specified in the above CSS or by using any JavaScript function?

Thanks,

Arpan
 
Hi mate,

The printer uses default settings, you cannot override that.

As for the margins, you can use the following but Opera has problems with it,

margin-top:0px;
margin-bottom:0px;
margin-left:0px;
margin-right:0px;

Hope this helps Wullie

sales@freshlookdesign.co.uk

The pessimist complains about the wind. The optimist expects it to change. The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top