第一步://html
<a href="javascript:void(0)" class="easyui-linkbutton" onclick="preview()" >打印</a>//按钮
<!--startprint-->//开始打印的标记
<table id="tbGrid"></table>//要打印的表格内容
<!--endprint-->//结束打印的标记
第二步://js
function preview() {
bdhtml = window.document.body.innerHTML;
sprnstr = "<!--startprint-->";
eprnstr = "<!--endprint-->";
prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
window.document.body.innerHTML = prnhtml;
window.print();
}