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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Big MontyWeb Ninja at largeCommented:
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
Big MontyWeb Ninja at largeCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook 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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.