We use cookies to provide you with a better experience. If you continue to use this site, we'll assume you're happy with this. Alternatively, click here to find out how to manage these cookies

hide cookie message
Contact Forum Editor

Send an email to our Forum Editor:


PLEASE NOTE: Your name is used only to let the Forum Editor know who sent the message. Both your name and email address will not be used for any other purpose.

Tech Helproom


It's free to register, to post a question or to start / join a discussion


 

Prevent headers/footers on page printer


Awestruck

Likes # 0

How can I prevent headers and footers printing when someone clicks the 'Print this page' button on website pages. By headers and footers I mean the website details, page numbers and date.
My button code is:-

!--Start of page printer-->
input type="button" value="Print this page" onclick="window.print()" title="Print this page">
!--End of page printer-->

Regards

Awestruck

Like this post
Kemistri

Likes # 0

Hide them and any other extraneous elements with your print stylesheet.

#id-of-element {display:none;}

Like this post
Awestruck

Likes # 0

Thank you Kemistri for your prompt reply. However, the headers and footers are not part of my web page. They are the headers and footers inserted by IE by default. In IE if you click File-->Page setup you will see

Header &w &b Page &p of P
Footer &u&b&d

These web client commands print the web address, page number, date etc which takes up space on the printed page.

I hoped to temporarily have these turned off when someone prints my page. I think I am asking the impossible.
Awestruck

Like this post
Kemistri

Likes # 0

It would have been helpful if you had described the problem more accurately - your post reads like you are asking about print stylesheets and, of course, most pages have headers and footers.

The print data, however, has nothing to do with a HTML and everything to with browser functionality. It is placed there by the browser. Some browsers allow print data to be customised or removed but we (rightly) have no control over that.

Why even worry about its presence anyway?

Like this post
Awestruck

Likes # 0

Hello Kemistri

I did spell it out but perhaps not clearly enough.

My original post said:-
"By headers and footers I mean the website details, page numbers and date".

None of my website pages have headers or footers.

Why worry? Because I try to get an order form to print out on one page rather than say a page and a quarter. To get the order form on one page, I need to eliminate some content on the order form because the IE header and footer take up valuable rows .

I must accept defeat on this one.
Regards
Awestruck

Like this post
Kemistri

Likes # 0

If you have a space issue, could you not make a bit of a space saving in your print stylesheet? Less padding in or around form inputs, for instance? Lots of potential for incremental reduction.

Incidentally, if your website has no headers or footers, where are your title, copyright notice, etc etc.? Just wondering.....

Like this post
Awestruck

Likes # 0

Hello Kemistri

Good point! I will try eliminating padding and unnecessary spaces in the print style sheet.

many thanks

Awestruck

Like this post

Reply to this topic

This thread has been locked.



IDG UK Sites

iPad mini 3 vs iPad mini 2 comparison: New iPad mini 3 isn't worth £80 more

IDG UK Sites

Why you shouldn't buy the iPad mini 3: No wonder Apple gave it 10 seconds of stage time

IDG UK Sites

Halloween Photoshop tutorials: 13 masterclasses for horrifying art, designs and type

IDG UK Sites

Should I upgrade from Mavericks to OS X 10.10 Yosemite? What you need to know before updating to...