title: print html table without a prompt a preview window
body: <p>I'm going to print a html table using a button and onclick function. 
  when i'm trying to do this it is prompt me a window always and from there i have to press again a button call print. then only the document is going to printer. </p>
  
  <p>so what i want is to print that table form one button click and without any prompt for print preview, is it possible to do it? and how? </p>
  
  <p>i'm using this code to print the table. </p>
  
  <pre><code>function printlayout() {
       var data = '&lt;input type="button" value="Print this page" onClick="window.print()"&gt;';           
         var DocumentContainer = document.getElementById('printlayout');
  var WindowObject = window.open('', "TrackHistoryData", 
                                "width=740,height=325,top=200,left=250,toolbars=no,scrollbars=yes,status=no,resizable=no");           
   WindowObject.document.writeln(DocumentContainer.innerHTML);
          WindowObject.document.close();
          WindowObject.focus();
          WindowObject.print();
          WindowObject.close();
   }
  </code></pre>
  
  <p>i know there is thousands of questions here similar to this but nothing helped me to solve my problem.. I mostly focusing the Google chrome browser to run my application.     </p>