如下表格大概如下
<table>
<tr>
<th>
<table><tr><th></th><th></th><th></th></tr></table></th>
<th>
<table><tr><th></th><th></th><th></th></tr></table></th>
<th>
<table><tr><th></th><th></th><th></th></tr></table></th>
</tr>
<table>
请问有jquery的插件能处理这样复制的表格么?或者是js 
谁能提供一个,十分感谢,最后有实例,谢谢先

解决方案 »

  1.   

    有个jquery table这个插件有这个功能的,通过flash来实现
      

  2.   

    兼容性好点就发送内容到服务器,又服务器处理,设置"Content-Disposition"响应头"attachment;filename=\"xxx.csv\"")要不就只能IE浏览器下的document.execCommand('SaveAs', 'xxx.csv');了,兼容性不是很好,而且好像指定的文件名和后缀没效果。。<div id="dv">
    <table>
    <tr>
    <th>
    <table><tr><th></th><th></th><th></th></tr></table></th>
    <th>
    <table><tr><th></th><th></th><th></th></tr></table></th>
    <th>
    <table><tr><th></th><th></th><th></th></tr></table></th>
    </tr>
    </table>
    </div>
    <iframe id="ifr" style="position:absolute;left:-999px;top:-999px;" src="javascript:void(0)"></iframe>
    <script type="text/javascript">
        window.onload = function () {
            if (!!document.all) { alert('非IE浏览器无法直接JS控制保存文件!'); return false; }
            var doc = document.getElementById('ifr').contentWindow.document;
            doc.open();
            doc.write(document.getElementById('dv').innerHTML);
            doc.close();
            doc.execCommand('SaveAs', 'xxx.csv');
        }
    </script>
      

  3.   

    if (!!document.all) { alert('非IE浏览器无法直接JS控制保存文件!'); return false; }这句错了,多了一次取非。。if (!document.all) { alert('非IE浏览器无法直接JS控制保存文件!'); return false; }
      

  4.   

    对了,补充问一下 jquery那么多表格插件,是那个?能告诉插件名字么?
      

  5.   

    客户端获取需要提交的容器的innerHTML发送给服务器端,服务器端很简单啊,主要是负责设置响应头和输出客户端提交的内容就好了。
    save.asp
    <%
    response.contenttype="text/csv"'设置类型为csv
    response.AddHeader "content-disposition","attachment;filename=""xxxxxxx.csv"""'设置以附件形式保存
    response.Write request.Form("csv")'输出客户端提交的csv内容即可
     %>
    test.html
    <!--这个是总的容器,提交容器的innerHTML-->
    <div id="dv">
    <table>
    <tr>
    <th>
    <table><tr><th></th><th></th><th></th></tr></table></th>
    <th>
    <table><tr><th></th><th></th><th></th></tr></table></th>
    <th>
    <table><tr><th></th><th></th><th></th></tr></table></th>
    </tr>
    </table>
    </div>
    <!---------提交表单前设置csv控件的内容未要导出的容器的innerHTML,将表单提交到隐藏的iframe来实现无刷新下载------------------->
    <form method="post" target="_blank" action="save.asp" onsubmit="this.csv.value=document.getElementById('dv').innerHTML"><input type="hidden" name="csv" /><input type="submit" value="保存" /></form>
    <iframe name="ifr" style="display:none"></iframe>客户端只能靠flash的实现保存文件的方法了,不过我没找到这种方法能将页面的内容传递给flash然后flash负责弹出保存内容对话框的,除非是flash air应用,而不是web的