일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- springboot
- db
- DP
- 피보나치
- DFS
- 알고리즘
- Spring
- IntelliJ
- join
- Database
- 프로그래머스
- 코테
- 탐욕법
- 이펙티브자바
- 우선순위큐
- Greedy
- mariaDB
- select
- 그리디알고리즘
- java
- SQL
- Effective Java
- 데이터베이스
- BFS
- mybatis
- 깊이우선탐색
- 정렬
- 다이나믹프로그래밍
- 백준
- 너비우선탐색
Archives
- Today
- Total
땀두 블로그
html 태그 프린트 방법 본문
function printHTML() {
var W = document.documentElement.clientWidth;
if(!W) {
W = document.body.clientWidth;
}
var H = document.documentElement.clientHeight;
if(!H) {
H = document.body.clientHeight;
}
var features = "menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=yes,resizable=yes,width=" + W + ",height=" + H + ",left=0,top=0";
var PrintPage = window.open("about:blank","print",features);
//css 속성들
var printDivCSSLinkRel1 = new String ("<link rel='stylesheet' type='text/css' href='/resources/css/common/common.css' />");
var printDivCSSLinkRel2 = new String ("<link rel='stylesheet' type='text/css' href='/resources/css/common/style.css' />");
PrintPage.document.open();
PrintPage.document.write("<!DOCTYPE html><html><head><title></title>" + printDivCSSLinkRel1 + printDivCSSLinkRel2 + "</head><body>" + document.getElementById('여기에 본인이 프린트할 태그의 아이디 값을 넣으면 됨').innerHTML + "</body></html>");
setTimeout(function(){
PrintPage.document.close();
PrintPage.print();
PrintPage.close();
}, 1000);
}
'Web > JSP & JQuery' 카테고리의 다른 글
css cursor option (0) | 2020.08.31 |
---|---|
JS에서 html 파일 pdf로 저장하여 다운로드 하기 (2) | 2020.08.10 |
$("selector").val(), $("selector").text(), $("selector").text() (0) | 2020.07.23 |
JQUERY 체크박스 선택 관련 (0) | 2020.07.23 |
readonly disabled 차이 (0) | 2020.06.16 |
Comments