用html导出的excel
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>
用html导出的excel的更多相关文章
- DataTable导出到Excel
简单的导出到Excel中: 代码如下: using System; using System.Collections.Generic; using System.Data; using System. ...
- ASP.NET中GridView数据导出到Excel
/// <summary> /// 导出按钮 /// </summary> /// <param name="sender"></para ...
- 【Java EE 学习 17 下】【数据库导出到Excel】【多条件查询方法】
一.导出到Excel 1.使用DatabaseMetaData分析数据库的数据结构和相关信息. (1)测试得到所有数据库名: private static DataSource ds=DataSour ...
- PB的datawindow导出到excel文件(使用saveasascii)
**********************************************************//*函数名称:uf_dwsaveas_excel功能:将数据窗口数据导出EXCEL ...
- 纯JS 将table表格导出到excel
html <div > <button type="button" onclick="getXlsFromTbl('tableExcel','myDiv ...
- 将页面上的内容导出到Excel
<asp:Button ID="lkbExport" runat="server" Name="Save" Text="导出 ...
- asp.net教程:GridView导出到Excel或Word文件
asp.net教程:GridView导出到Excel或Word文件</ br> 在项目中我们经常会遇到要求将一些数据导出成Excel或者Word表格的情况,比如中国移动(我是中国移动用户) ...
- DataGridView导出到Excel的三个方法
#region DataGridView数据显示到Excel /// <summary> /// 打开Excel并将DataGridView控件中数据导出到Excel /// </s ...
- salesforce 零基础学习(二十三)数据记录导出至excel(自定义报表导出)
我们都知道,报表有个功能为导出excel,但是有的时候客户需求往往标准的报表达不到,比如导出excel,其中本月修改的数据字段标红,如下图所示. 这就需要我们去写VF来实现此功能. 需求:将数据表记录 ...
- HTML Table导出为Excel的方法
HTML Table导出为Excel的方法: 直接上源码 <html> <head> <meta http-equiv="Content-Type" ...
随机推荐
- pip工具下载速度慢的问题
由于pip安装默认的访问地址为 http://pypi.python.org/simple/ 为外网,速度慢而且容易超时报错 国内常用的镜像源有 :阿里云 http://mirrors.aliyun. ...
- Ubuntu系统Apache2部署SSL证书
参考链接: https://help.aliyun.com/document_detail/102450.html?spm=a2c4g.11186623.6.582.17b74c07mBaXWS
- Vue.js 源码目录设计(二)
Vue.js 的源码都在 src 目录下,其目录结构如下. src ├── compiler # 编译相关 ├── core # 核心代码 ├── platforms # 不同平台的支持 ├── se ...
- python基础数据类型整理
一.数据类型 (一).小技巧 1.PyCharm:选中多行,按"Ctrl+/"可批量注释掉 (二).字符串 1.startswith(str,[,start][,end]) #判断 ...
- 题解【洛谷P3958】[NOIP2017]奶酪
题面 题解 我们考虑使用一个并查集维护空洞之间的关系. 如果两个空洞能相互到达,那么它们的祖先也是相同的. 枚举从哪一个空洞开始,能否到达奶酪的上表面. 如果能到达就输出Yes,否则输出No. 注意开 ...
- [CF1220C] Substring Game in the Lesson - 博弈论
[CF1220C] Description 给定一个字符串 \(S\) , 同时维护一个区间 \([l,r]\) .轮流操作,每次可以扩展到一个新区间使得原区间是新区间的真子区间,并且字典序更小,不能 ...
- Tomcat解压版-环境配置
[问题]Tomcat解压版在本地后,双击双击startup.bat,闪退 [解决办法] 1.在已解压的tomcat的bin文件夹下找到startup.bat,右击->编辑.在文件头加入下面 ...
- hdu1716 排列2
12 21 123 132 213 231 321 312 .... 每次都将后面n-1位进行全排列.递归的出口当起始坐标等于终止坐标时.需要还原. 设计标记数组.因为需要从小到大输出. #def ...
- 关于Win32串口
因为近段时间接触Hid相对来说多一些,由此忽略了串口中获取cbInQue这个重要的东西,下面是错误代码 // Win32SerialPortLib.cpp : 定义 DLL 应用程序的导出函数. // ...
- echarts修改X、 Y坐标轴字体的颜色
1.背景:在项目中常常会用到echarts的实例,根据不同的需求字体颜色需要变化,如图,要切合背景,就需要更改字体颜色 2.解决方案 xAxis : [ { type : 'category', da ...