<html>
<head>
<title>원하는 부분만 인쇄하기</title>
<script language="JavaScript">
var initBody
function beforePrint(){
initBody = document.body.innerHTML;
document.body.innerHTML = resultList.innerHTML;
}
function afterPrint(){
document.body.innerHTML = initBody;
}
function printArea(){
window.print();
}
window.onbeforeprint = beforePrint;
window.onafterprint = afterPrint;
</script>
</head>
<body>
기본 문서 내용 ...< br> . <br> . <br> . <br>
인쇄할 때 제외될 영역 입니다. <br><br>
<div id="idPrint" style="width:320px;height:90px;overflow-x:hidden; overflow-y:auto;">
<table width="300" border="1">
<tr>
<td>1.이 부분만 인쇄를 하고 싶습니다.</td>
</tr>
<tr>
<td>2.이 부분만 인쇄를 하고 싶습니다.</td>
</tr>
<tr>
<td>3.이 부분만 인쇄를 하고 싶습니다.</td>
</tr>
<tr>
<td>4.이 부분만 인쇄를 하고 싶습니다.</td>
</tr>
<tr>
<td>5.이 부분만 인쇄를 하고 싶습니다.</td>
</tr>
<tr>
<td>6.이 부분만 인쇄를 하고 싶습니다.</td>
</tr>
</table>
</div><br>
<input type="button" value="부분 출력하기" onclick="printArea();">
</body>
</html>
<head>
<title>원하는 부분만 인쇄하기</title>
<script language="JavaScript">
var initBody
function beforePrint(){
initBody = document.body.innerHTML;
document.body.innerHTML = resultList.innerHTML;
}
function afterPrint(){
document.body.innerHTML = initBody;
}
function printArea(){
window.print();
}
window.onbeforeprint = beforePrint;
window.onafterprint = afterPrint;
</script>
</head>
<body>
기본 문서 내용 ...< br> . <br> . <br> . <br>
인쇄할 때 제외될 영역 입니다. <br><br>
<div id="idPrint" style="width:320px;height:90px;overflow-x:hidden; overflow-y:auto;">
<table width="300" border="1">
<tr>
<td>1.이 부분만 인쇄를 하고 싶습니다.</td>
</tr>
<tr>
<td>2.이 부분만 인쇄를 하고 싶습니다.</td>
</tr>
<tr>
<td>3.이 부분만 인쇄를 하고 싶습니다.</td>
</tr>
<tr>
<td>4.이 부분만 인쇄를 하고 싶습니다.</td>
</tr>
<tr>
<td>5.이 부분만 인쇄를 하고 싶습니다.</td>
</tr>
<tr>
<td>6.이 부분만 인쇄를 하고 싶습니다.</td>
</tr>
</table>
</div><br>
<input type="button" value="부분 출력하기" onclick="printArea();">
</body>
</html>
댓글
댓글 쓰기