Can i use javascript to print the contents of a html table only?
When i use the window.print() method it prints the whole page including the print button.Can anybody help me please ?
Thanks..
Not sure if this is the best way to do this but I when printing I would redirect to a print page which contains nothing but the table you want to print. Call the windows.print function and then redirect back to the original page.
I guess this is an ASP created Table right? As a refinement to using another window, Internet Explorer can use this:
<LINK REL=ALTERNATE MEDIA=PRINT href="printablePage.htm">
You could make use of this, if you wrote that page dynamically - this page is printed automatically when window.print() is invoked.
This will involve a little bit of work writing and saving the printable page to your server, but the bonus is you don't get a pop-up. Just an idea.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.