본문 바로가기
JAVASCRIPT/프린트로 인쇄

프린트로 인쇄 하기

by 정윤재 2009. 9. 2.


아주 간단하다

window.print(); 메소드를 쓰면 되는 것이다.

<%@ page language="java" contentType="text/html; charset=EUC-KR"
    pageEncoding="EUC-KR"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "
http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=EUC-KR">
<title>Insert title here</title>
<script>
function sub(){

 window.print();
 
}
</script>
</head>
<body>
<input type="button" onClick="sub();" value="print">
<table border="1">
 <tr><td>aaaaaaaaaaaaaaaaaa</td></tr>
 <tr><td>bbbbbbbbbbbbbbbbbbb</td></tr>
</table>
</body>
</html>


댓글