<a href="#" onclick="printArea()">인쇄하기NEW</a>
 

 

적당한 곳에 인쇄 링크를 넣는다.

Put the print link in the appropriate place as above.

 

 

 

<!-- 엣지때문에 2022-12월에 추가함 -->
<script type="text/javascript">
<!--
var initBody;

function beforePrint() {
boxes = document.body.innerHTML;
document.body.innerHTML = box.innerHTML;
}
function afterPrint() {
document.body.innerHTML = boxes;
}
function printArea() {
window.print();
}

window.onbeforeprint = beforePrint;
window.onafterprint = afterPrint;

-->
</script>
 

이러한 스크립트를 head 안에 body 위 정도 적당한 곳에 넣는다.

Put these scripts in the head in the right place above the body.

 

 

<div ID="box">

 

<table border=1 cellspacing=0 width=350>
.....


</div>

 

인쇄를 원하는 영역에 div로 box를 지정한다.

Specify the box as a div in the area you want to print.