<html>
<head>
<script src="jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="jquery.printArea.js" type="text/javascript"></script>
<script>
$(document).ready(function() {
//////////
// PrintArea
///////////
$("#printButton").click(function(){
$("#printable").printArea();
});
});
</script>
</head>
<body>
<p><b>Example 5: PrintArea - Only the actual table will print, not the titles</b>
<p>An advertisement that you don't want printed out.
<p>Another advertisement that you don't want printed out.
<div id=printable>
<table width=40% cellpadding=3 cellspacing=0 border=1>
<tr><th>Name</th><th>Age</th><th>Height</th></tr>
<tr><td>John Q</td><td>23</td><td>6'1"</td></tr>
<tr><td>Jane Q</td><td>23</td><td>5'1"</td></tr>
<tr><td>Jimmy R</td><td>23</td><td>5'6"</td></tr>
<tr><td>Jamie W</td><td>23</td><td>5'9"</td></tr>
</table>
</div>
<p><input type=button id=printButton value="Print">
<p>All the annoying disclaimer text you don't want printed out.
</body>
</html>
'JAVASCRIPT' 카테고리의 다른 글
jQuery ajaxForm plugin (form submit) (0) | 2013.06.17 |
---|---|
jQuery 모바일 터치슬라이드 (0) | 2013.05.29 |
jQuery 엔터키 이벤트 (0) | 2013.05.13 |
jQuery 숫자 포멧 변경 (콤마..) (0) | 2013.05.06 |
URL 정보 확인 (0) | 2013.04.11 |