选择,从IE复制并粘贴到Excel [英] Select, Copy from IE and paste to Excel

查看:402
本文介绍了选择,从IE复制并粘贴到Excel的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以基本的问题是,如何使表格从IE到Excel或OpenOffice计算复制粘贴。
该页面位于: http://tuudik.lohv.eu/Asjad/EURXML /

So the basic question is, how can I make table nicely copy pastable from IE to Excel or OpenOffice calc. The page is located here: http://tuudik.lohv.eu/Asjad/EURXML/

表是由PHP代码动态创建的。有一个按钮与tekstVali tabel!这意味着,它选择表。然后我想复制它,例如使用 CTRL + C ,并将其粘贴到电子表格中。

The table is created dynamically by PHP code. There's a button with tekst "Vali tabel!" which means, it selects the table. Then I want to copy it, for example using CTRL+C and paste it into a spreadsheet.

是最好的选择?我应该创建一个隐藏的div,然后具有相同的数据,如在表中,但格式化为其他方式?

What are the best options? Should I create a hidden div what then has the same Data like in the table but formatted other way?

此外,任何人都知道如何使Valikõik!

Also, anyone knows how to make the "Vali kõik!" button work so, that it would automatically copy the contents to the clipboard?

推荐答案

为什么不修改你的PHP脚本来写页面内容直接写入Excel,将内容写入Excel单元格,而不是写入
< td>元素,然后设置标题下载它...所以传递一个额外的'format'参数到您的脚本可以确定输出格式为XLS的HTML。 PHPExcel 库提供以纯PHP生成XLS文件的功能。然后,HTML页面上的链接可以提供选项,直接将输出重新创建为XLS文件以供下载,而不是复制和粘贴。

Why not modify your PHP script to write the page content directly to Excel, writing the content to excel cells rather than HTML where you're writing to the <td> elements, then set the headers to download it... so passing an additional 'format' parameter to your script could determine the output format as HTML of XLS. The PHPExcel library offers the capability of generating XLS files in pure PHP. A link on your HTML page could then offer the option to recreate the output directly as an XLS file for download, rather than copy-and-paste.

这篇关于选择,从IE复制并粘贴到Excel的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆