View Single Post
Old 13-02-2006, 22:19   #2
punky
Inactive
 
Join Date: Jun 2003
Age: 45
Posts: 14,750
punky has a golden aurapunky has a golden aura
punky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aurapunky has a golden aura
Re: javascript. window.print

Easiest way to do it is to spawn a new window, write to it, print it, close it.

like this:

Code:
//Open a new window

newwin = open("","newwin","width=400, height=250, status=no, toolbar=no, menubar=no, scrollbars=yes");


//write to it

newwin.document.write('<html><body>');

//write table code here

newwin.document.write('<table>...</table>');

//write end code

newwin.document.write("<br><br><center><input type=button value='Close This Window' onClick='javascript:window.close();'></body></html>");

//try and close the window automatically

newwin.close();
punky is offline   Reply With Quote