Viewing file: test.php (1.23 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<script type="text/javascript">
function print1(strid) { if(confirm("Do you want to print?")) { var values = document.getElementById(strid); var printing = window.open('','','left=0,top=0,width=550,height=400,toolbar=0,scrollbars=0,sta?tus=0'); printing.document.write(values.innerHTML); printing.document.close(); printing.focus(); printing.print(); printing.close(); } } </script> <div id="print2"> <table width="40%" cellpadding='0' cellspacing='0' border="1"> <tr bgColor="#ccc"> <th>Sno</th><th>Name</th><th>Address</th> </tr> <tr> <td>1</td><td>sonu</td><td>6355</td> </tr> <tr> <td>2</td><td>ankush</td><td>hno 3322</td> </tr> <tr> <td>3</td><td>dimple</td><td>hno 1245</td> </tr> <tr> <td>4</td><td>reena</td><td>3344</td> </tr> <tr> <td>5</td><td>sonu</td><td>6355</td> </tr> <tr> <td>6</td><td>ankush</td><td>hno 3322</td> </tr> <tr> <td>7</td><td>dimple</td><td>hno 1245</td> </tr> <tr> <td>8</td><td>reena</td><td>3344</td> </tr> </table> </div> <br/><br/> <input type="button" name="printbutton" value="Prin table" onclick="return print1('print2')"/>
|