html中的table给导出execl ,只有table 可以 其他不行

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8"> <script src="../../public/js/jquery.min.js"></script> <script src="jquery.table2excel.js"></script>
</head>
<body> <div id='datatable'>
<img src="data:images/arrow_Down.png" alt="">
这是一个段落test
<table cellspacing="0" cellpadding="0" class="xd_table_sj"> <tbody>
<tr>
<td><div align="center" id="titlelable">起始时间</div></td>
<td><div align="center" id="titlelable">通信地点</div></td>
<td><div align="center" id="titlelable">上网方式</div></td>
<td><div align="center" id="titlelable">总时长</div></td>
<td><div align="center" id="titlelable">总流量</div></td>
<td><div align="center" id="titlelable">套餐优惠</div></td>
<td><div align="center" id="titlelable">优惠或减免</div></td>
<td><div align="center" id="titlelable">通信费</div></td>
<td><div align="center" id="titlelable">终端类型</div></td>
</tr> <tr bgcolor="#EFFEDD" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#EFFEDD'" style="background: rgb(239, 254, 221);">
<td>10-01 01:57:05</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.001</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#ffffff" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#ffffff'" style="background: rgb(255, 255, 255);">
<td>10-01 01:58:55</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.007</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#EFFEDD" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#EFFEDD'" style="background: rgb(239, 254, 221);">
<td>10-01 07:00:00</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.001</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#ffffff" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#ffffff'" style="background: rgb(255, 255, 255);">
<td>10-01 07:23:19</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.084</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#EFFEDD" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#EFFEDD'" style="background: rgb(239, 254, 221);">
<td>10-01 08:16:31</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.001</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#ffffff" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#ffffff'" style="background: rgb(255, 255, 255);">
<td>10-01 08:16:39</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.06</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#EFFEDD" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#EFFEDD'" style="background: rgb(239, 254, 221);">
<td>10-01 08:28:44</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.002</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#ffffff" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#ffffff'" style="background: rgb(255, 255, 255);">
<td>10-01 08:34:50</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.259</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#EFFEDD" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#EFFEDD'" style="background: rgb(239, 254, 221);">
<td>10-01 08:34:50</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>1.26</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#ffffff" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#ffffff'" style="background: rgb(255, 255, 255);">
<td>10-01 09:54:53</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>1.357</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#EFFEDD" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#EFFEDD'" style="background: rgb(239, 254, 221);">
<td>10-01 09:56:29</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.003</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#ffffff" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#ffffff'" style="background: rgb(255, 255, 255);">
<td>10-01 09:56:31</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.009</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#EFFEDD" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#EFFEDD'" style="background: rgb(239, 254, 221);">
<td>10-01 09:56:33</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.583</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#ffffff" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#ffffff'" style="background: rgb(255, 255, 255);">
<td>10-01 10:27:16</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.001</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#EFFEDD" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#EFFEDD'" style="background: rgb(239, 254, 221);">
<td>10-01 10:28:58</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.004</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#ffffff" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#ffffff'" style="background: rgb(255, 255, 255);">
<td>10-01 12:44:12</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.001</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#EFFEDD" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#EFFEDD'" style="background: rgb(239, 254, 221);">
<td>10-01 12:45:41</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.411</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#ffffff" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#ffffff'" style="background: rgb(255, 255, 255);">
<td>10-01 12:57:42</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.024</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#EFFEDD" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#EFFEDD'" style="background: rgb(239, 254, 221);">
<td>10-01 12:57:50</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.009</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> <tr bgcolor="#ffffff" onmouseover="this.style.background='#D2FCA0'" onmouseout="this.style.background='#ffffff'" style="background: rgb(255, 255, 255);">
<td>10-01 12:57:52</td>
<td></td>
<td>CMNET</td>
<td>0秒</td>
<td>0.007</td>
<td>校园4G套餐-400M国内流量</td>
<td></td>
<td>0.00</td>
<td></td>
</tr> </tbody>
</table>
<button>导出EXCEL</button>
</div>
<script>
$('button').click(function(){
console.log(1)
$("#datatable").table2excel({
exclude: ".noExl",
name: "Excel Document Name",
filename: "myFileName",
exclude_img: true,
exclude_links: true,
exclude_inputs: true
});
}) // table2excel插件的可用配置参数有:
//
// exclude:不被导出的表格行的CSS class类。
// name:导出的Excel文档的名称。
// filename:Excel文件的名称。
// exclude_img:是否导出图片。
// exclude_links:是否导出超链接
// exclude_inputs:是否导出输入框中的内容。 </script>
</body>
</html>

最新文章

  1. Java通过ODBC链接数据库并遍历结果的一个问题
  2. linux挂载远程samba目录
  3. Java中的try,catch,finally
  4. css3 animation 实现环形路径平移动画
  5. 最短路径之迪杰斯特拉(Dijkstra)算法
  6. Android Intent个人介绍
  7. Codeforces Bubble Cup 8 - Finals [Online Mirror] F. Bulbo DP
  8. 利用if else 求已发奖金总数
  9. [Falcor] Indroduce to Model
  10. .Net Errors
  11. 滚动视差效果——background-attachment
  12. 转 awk 使用方法
  13. linux优化之SElinux关闭
  14. win10 uwp 右击选择 GridViewItem
  15. springboot开启事务支持时报代理错误
  16. 《Java项目中classpath路径详解》
  17. video maker &amp; video tutorials
  18. 20165205 2017-2018-2 《Java程序设计》第六周学习总结
  19. Java判断一个时间是否在时间区间内
  20. spark-submit的参数名称解析

热门文章

  1. docker的个人理解
  2. java中的多构造函数以及类字段的初始化顺序
  3. tomcat常见状态码
  4. HDFS写入数据
  5. Linux - mysql 异常:登录不上mysql数据库
  6. 开放系统互联(OSI)模型
  7. Oracle11g配置监听
  8. windows10 安装盘制作以及重装系统
  9. mysql行级锁 select for update
  10. 复选框与bitmap算法实践