1,首先映入jQuery插件 连接打印机 需要使用到JavaScript中window.print()方法把要打印的内容包裹在 ,通过开始、结束标记<!--startprint--> <!--endprint-->
<!--startprint-->
要打印的内容
<!--endprint-->
2,使用jQuery拿到元素实现数据绑定 拿到后台返回数组 循环渲染到页面
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>外卖打印</title>
</head>
<style>
.waimai{
text-align: left;
border-bottom: 1px solid #000000;
}
.shopBox{
list-style: none;
}
</style>
<body>
<!--startprint-->
<table class="waimai">
<tr style="width: 100%;">
<td><span class="zong">天 地 和 外
卖</span> <br /></td>
</tr>
<tr>
<td>