0
<script>
function myFunction() {


window.print();
}
</script>
<form >
<input type="submit" value="Submit">
</form>

But I need to print Just My table Tr only

iarifbd
  • 11
  • 5

1 Answers1

0

Picked the code from here Print a div content using Jquery

function myFunction() 
{

  var divToPrint=document.getElementById('IdOfDivTobePrinted');

  var newWin=window.open('','Print-Window');

  newWin.document.open();

  newWin.document.write('<html><body onload="window.print()">'+divToPrint.innerHTML+'</body></html>');

  newWin.document.close();

  setTimeout(function(){newWin.close();},10);

}
Community
  • 1
  • 1
Anil
  • 3,722
  • 2
  • 24
  • 49