一、使用插件
1.jquery.jqprint-0.3.js
二、編寫HTML文件
<script src="./js/jquery-3.1.1.min.js"></script>
<script src="./js/jquery.jqprint-0.3.js"></script>
<script src="./js/print.js"></script>
<div>
<span id="download">打印</span>
</div>
<div class="data-table" id="download-table">
<table class="table table-hover">
<thead>
<tr>
<td>項目員</td>
<td>任務分值</td>
<td>日志分值</td>
<td>績效分值</td>
<td>績效額度</td>
</tr>
</thead>
</table>
</div>
三、編寫js文件
$(function () {
$("#print").click(function () {
$( '#download-table' ).jqprint({
debug: false,
importCSS: true,
printContainer: true,
operaSupport: false
});
});
})