一、使用插件
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
});
});
})