Print an element of the screen

I currently have code to print the entire screen of a report, but it includes nav bar and buttons that the end user doesn't want. what they want printed is the table.

The table has an ID, it is :

<table width="100%"  class="tablesample" id="results">


<a href="#" onClick="window.print();return false" title="Print"><img src="../../../Images/prints.gif" width="25" height="20" alt=""/></a>

How can I modify the code about so that it only prints the object with id = 'results'  ?
LVL 1
AleksAsked:
Who is Participating?
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
the window.print() simply prints the rendered page, as is. it's up to you to build that page in the way you want printed...
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Commented:
have a look at this question

http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/HTML/Q_28635559.html

you'll need to add a "print" css stylesheet that you will set which objects on your page you want to print.

you're other option is to redirect the user to a printer friendly page, which is a page that only has what you want printed on it.

I would go with the first option if it was me...
0
 
AleksAuthor Commented:
Ummm .. ok I guess. Thought there would be an easier way to do by simply printing a specific object instead of blocking those which I don't want
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
AleksAuthor Commented:
I know .. what I meant was I thought there could be a parameter passed to the 'print' action so it would print that one element and not ALL which is what it does by default.
I have a DW extension that does this but prints to PDF or Excel, not to printer  :#
0
 
AleksAuthor Commented:
Actually they do have an extension for that ... what do you know ... thanks for the help tho.
0
 
AleksAuthor Commented:
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.