<html>
<head>
<script type="text/javascript">
var tableToExcel = (function () {
var uri = 'data:application/vnd.ms-excel;base64,'
, template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>'
, base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))) }
, format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }) }
return function (table, name) {
if (!table.nodeType) table = document.getElementById(table)
var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML }
window.location.href = uri + base64(format(template, ctx))
}
})()
</script>
</head>
<body>
<h1>
tableToExcel Demo</h1>
<p>
Exporting the W3C Example Table</p>
<input type="button" onclick="tableToExcel('GridViewBoiler', 'W3C Example Table')"
value="Export to Excel">
<table cellspacing="0" cellpadding="4" rules="all" border="1" id="Table1" style="color: #333333;
width: 100%; border-collapse: collapse;">
<tbody>
<tr style="color: White; background-color: #507CD1; font-weight: bold;">
<th scope="col">
序号
</th>
<th scope="col">
参数描述
</th>
<th scope="col">
--望亭发电有限公司--#11机组--锅炉本体试验--2015-02-09 14:40:53--
</th>
</tr>
<tr style="background-color: #EFF3FB;">
<td align="center">
1
</td>
<td align="left">
入炉煤收到基低位发热量(KJ/Kg)
</td>
<td>
19600.0000
</td>
</tr>
<tr style="background-color: White;">
<td align="center">
2
</td>
<td align="left">
入炉煤收到基灰分(%)
</td>
<td>
23.6000
</td>
</tr>
<tr style="background-color: #EFF3FB;">
<td align="center">
3
</td>
<td align="left">
入炉煤收到基水分(%)
</td>
<td>
4.1800
</td>
</tr>
<tr style="background-color: White;">
<td align="center">
4
</td>
<td align="left">
入炉煤收到基碳含量(%)
</td>
<td>
57.4900
</td>
</tr>
<tr style="background-color: #EFF3FB;">
<td align="center">
5
</td>
<td align="left">
入炉煤收到基氢含量(%)
</td>
<td>
3.6500
</td>
</tr>
<tr style="background-color: White;">
<td align="center">
6
</td>
<td align="left">
入炉煤收到基氧含量(%)
</td>
<td>
9.9500
</td>
</tr>
<tr style="background-color: White;">
<td align="center">
20
</td>
<td align="left">
换算至设计送风温度时的排烟温度(%)
</td>
<td>
122.0239
</td>
</tr>
<tr style="background-color: #EFF3FB;">
<td align="center">
21
</td>
<td align="left">
修正后锅炉热效率(%)
</td>
<td>
91.2669
</td>
</tr>
</tbody>
</table>
</body>
</html>

最新文章

  1. 命令行环境下简单实用的工具——重定向&amp;管道
  2. 初识React Native,踩坑之旅....
  3. HTML Meta标签
  4. csharp:引入app.manifest,程序在win7下以管理员权限运行配置方法
  5. Java的多线程机制系列:(四)不得不提的volatile及指令重排序(happen-before)
  6. c++STL之sort排序
  7. 播放器音乐源之天天动听API
  8. BZOJ 4199: [Noi2015]品酒大会( 后缀数组 + 并查集 )
  9. iOS内存错误EXC_BAD_ACCESS的解决方法(message sent to deallocated instance)
  10. How to change from default to alternative Python version on Debian Linux
  11. Python并发编程之线程中的信息隔离(五)
  12. 使用styled-components实现CSS in JS
  13. Fedora 23 U盘启动出现“Failed to load ldlinux.c32”解决
  14. 比较安全的cookie验证登录设计方案
  15. MT【66]寻找对称中心
  16. 【数学】NOIP数论内容整理
  17. 给父元素与子元素分别设置visibility注意点
  18. 请问WCF 跟 WebService之间的相同跟异同
  19. Mac下IDE无法读取环境变量问题
  20. 解决Ubuntu/debian的Apt-get 由于依赖关系安装失败的问题

热门文章

  1. collections模块
  2. mysql 文件导入
  3. WIN7 启动屏幕键盘
  4. Appium Demo
  5. FCN 项目部分代码学习
  6. C:\Users\Administrator\.IntelliJIdea2017.3\system\tomcat\Unnamed_08_upload\work\Catalina\localhost\ROOT这个错误是找不到temp文件
  7. (转)HTTPS到底是个啥玩意儿?
  8. 如何把网址配置为http和https可以同时访问
  9. C#学习-属性是对字段的扩展
  10. Vs2015 本地git获取的代码目录文件修改后,启动提示error:Unable to start program “C:\Program Files\dotnet\dotnet.exe” 已解决.