View Full Version : How to disable header and footer?
chleng
06-16-2005, 02:49 AM
Hi, I'm using php to generate a bill.
Problem is whenever I print the form, if the user didn't set the header and footer in the page set up menu in the browser, it will print both head and printer. How should I do about it.
thks.
rgds
_Aerospace_Eng_
06-16-2005, 08:17 AM
Use CSS, you can set the header and footer to display none at print.
<style type="text/css" media="print">
#header,#footer {
display:none;
}
</style>
That is just a basic example that would go in your head tags, but without knowing your code looks like its kinda hard to tell if those are the correct id's for your header and footer or if they even have an id, if not give them one but you might put the id in the wrong spot so to be sure we need to see your code.
glenngv
06-16-2005, 01:02 PM
I think chleng was referring to the header/footer (such as page title, URL, and the like) put up by browser when the page is printed and not the user created header/footer of the page. Since that is a browser setting, javascript has no read/write access to that. What you can do is put a note in the page that informs the user how to remove the header/footer in Page Setup dialog.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.