-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
86 lines (81 loc) · 2.27 KB
/
index.html
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquerymigrate.js"></script>
<script type="text/javascript" src="js/jqprint.js"></script>
<link rel="stylesheet" href="css/style.css">
<link href="css/print.css" rel="stylesheet" media="print"/>
</head>
<body>
<div id="table1">
<div id="print1" class="breakpage">
<table>
<thead>
<tr>
<th>表头1</th>
<th>表头2</th>
<th>输入框</th>
</tr>
</thead>
<tbody>
<tr>
<td>1221</td>
<td>1221</td>
<td>1221</td>
</tr>
</tbody>
</table>
</div>
</div>
<div id="table2" class="breakpage">
<div id="print2">
<table>
<thead>
<tr>
<th>表头1</th>
<th>表头2</th>
<th>输入框</th>
</tr>
</thead>
<tbody>
<tr>
<td>1221</td>
<td>1221</td>
<td>1221</td>
</tr>
</tbody>
</table>
</div>
</div>
<div>
<iframe src="https://ghbtns.com/github-btn.html?user=k186&repo=multiple-print&type=star&count=true" frameborder="0"></iframe>
<iframe src="https://ghbtns.com/github-btn.html?user=k186&repo=multiple-print&type=fork&count=true" frameborder="0"></iframe>
</div>
<div id="btn1" class="btn">打印table1</div>
<div id="btn2" class="btn">打印table2</div>
<div id="btn3" class="btn">打印table1和table2并且强制分页</div>
</body>
<script>
$('#btn1').click(function () {
$('#print1').jqprint({
debug:false
})
});
$('#btn2').click(function () {
$('#print2').jqprint({
debug:false
})
});
$('#btn3').click(function () {
/*var $temp = $("<iframe class='mulitprint-box' id='mulit' style='position: absolute; width: 0px; height: 0px; left: -600px; top: -600px;'></iframe>");
$temp.html($('#print1').outer()+$('#print2').outer());
$temp.appendTo('body');*/
$('#print1,#print2').jqprint({
debug:false
})
});
</script>
</html>