惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

A
About on SuperTechFans
小众软件
小众软件
WordPress大学
WordPress大学
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
博客园 - 三生石上(FineUI控件)
博客园_首页
N
Netflix TechBlog - Medium
IT之家
IT之家
H
Help Net Security
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
罗磊的独立博客
T
Tailwind CSS Blog
F
Fortinet All Blogs
Hugging Face - Blog
Hugging Face - Blog
MongoDB | Blog
MongoDB | Blog
V
V2EX
量子位
云风的 BLOG
云风的 BLOG
爱范儿
爱范儿
博客园 - 司徒正美
The Cloudflare Blog
Engineering at Meta
Engineering at Meta

博客园 - 流云之心

招人啦 - 前端,后台开发专家 为什么不给程序员配好电脑 [翻译] SQL Server中对XML操作 开发常用小工具介绍 设计模式一 - Simple Factory, Factory Method, Abstract Factory以及Builder模式简述 强制休息程序 - EyeGuardian 眼睛守护者 Beta测试版 定时计划任务方案比较以及通过脚本创建计划任务(SchTasks命令) Excel Programming (C# + VBA) Part III Excel Programming (C# + VBA) Part II Excel programming (C# + VBA) Part 1 Harry Potter - The Half-Blood Prince 转移阵地了,新地址:http://spaces.msn.com/members/PuGong 关于XMLHTTP object的OPEN方法 smart client优势在那里? (草稿) SQL Server的collation问题 Microsoft Interview Question links 转自http://blogs.msdn.com/chappell/archive/2004/07/20/189364.aspx MSN to expand free e-mail storage to 250MB 用 #inculde file = "../fiel" 报1031错误 用<!--include file = ../ --> 报错误1031
javascript 将页面上的Table导出保存为Excel (无格式) - 流云...
流云之心 · 2007-12-06 · via 博客园 - 流云之心

 接受参数:Table的 ID

function tableToExcel(tblName)   
{
  
function String.prototype.Trim() {return this.replace(/(^\s*)|(\s*$)/g,"");}
  
try
  
{
    
var e = document.getElementById(tblName);
    
var s = ""
    
for (var j=0; j<e.rows.length; j++)
    
{
      
if (e.rows[j].style.display != "none")
      
{
        
for (var i=1; i<e.rows[j].cells.length; i++)
        
{
          
if (e.rows[j].cells[i].style.display != "none"
            s 
+= e.rows[j].cells[i].innerText.Trim() +"\t";
        }

        s 
+= "\r\n";
      }

    }

    
var xlsWindow = window.open("","_blank","width=100,height=100");
    xlsWindow.document.write(s);
    xlsWindow.document.execCommand('Saveas',
true,'%homeDrive%\\Data.xls');
    xlsWindow.close();
  }

  
catch(e)
  
{}
}