是否可以使用多个工作表/标签将HTML文档转换为Excel? [英] Is it possible to convert an HTML document to Excel with multiple Worksheets/tabs?

查看:342
本文介绍了是否可以使用多个工作表/标签将HTML文档转换为Excel?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我们可以通过管道发送普通的html文件,并让浏览器以Excel文件的形式打开它们(通过更改http头文件名和文件名,然后excel进行转换)。但是,是否有可能在Excel中使用两个工作表/标签显示HTML文档?

这是我认为可能工作的,但没有完全得到这份工作完成:

 < html> 
< body>
< table>
....
< / table>
< hr class ='pageBreak'/> < =我想也许这会把东西分成
< table>
....
< / table>
< body>
< / html>

是否有工作表选项卡或某种名称空间我可以添加到html以创建多个工作表?



编辑只要好奇别人是否有任何想法......: - /



(我使用的是Ruby,所以如果您知道一个将HTML标签转换为某种Excel工作表对象的库,那也可以)

解决方案

尝试用于生成OLE文档(如Excel电子表格)的Ruby POI( http://poi.apache.org/poi-ruby.html )。



如果您需要处理导入.xls文件,ExcelParser gem非常棒( http://raa.ruby-lang.org/project/parseexcel/)。

I know we can send regular html files through the tubes and have the browser open them as Excel documents (you do that by changing http headers and the file name, then excel does the conversion). BUT, is it possible to get an HTML document show up in Excel with two Worksheets/Tabs?

Here's what I thought might work, but didn't quite get the job done:

<html>
  <body>
    <table>
      ....
    </table>
    <hr class='pageBreak' />      <= I thought perhaps this would divide stuff up
    <table>
      ....
    </table>
  <body>
</html>

Is there a worksheet tab or some kind of namespace I could ADD to html in order to create multiple worksheets?

EDIT Just curious if anyone else has any ideas... :-/

(I'm using Ruby, so if you know of a library that will convert HTML tags to an Excel worksheet object of some sort, that might work too)

解决方案

Try Ruby POI for generating OLE documents like Excel spreadsheets ( http://poi.apache.org/poi-ruby.html ).

The ExcelParser gem is wonderful if you need to handle importing .xls files as well ( http://raa.ruby-lang.org/project/parseexcel/ ).

这篇关于是否可以使用多个工作表/标签将HTML文档转换为Excel?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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