如何创建单个HTML文件在Excel中查看多张表? [英] How create single HTML file to viewed in Excel with multiple sheets?

查看:153
本文介绍了如何创建单个HTML文件在Excel中查看多张表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否可以创建一个单独的HTML文件(在使用Excel打开后,将其扩展名改为.xls),将解析为多张。

I would like to know if it is possible to create a single HTML file which (after changing its extension to .xls) when opened with Excel, will parsed to multiple sheets.

一个例子:

我有一个文件 test.xls ,内容如下:

I've got a file test.xls with the content :

<html>
<body>
<table>
<tr>
 <td>
 1
 </td>
 <td>
 2
 </td>
 <td>
 3
 </td>
 <td>
 =sum(A1:C1)
 </td>

</tr>
</table>
</body>
</html>

当我用Excel打开这个文件时,我得到一张Sheet,其中A4的单元格的计算总和A1到C1 = 6。

When I open this file with Excel I get one Sheet with calculated sum of cells A1 to C1 in A4=6.

我想知道是否可以创建一个包含多个表的HTML文件,这些表将在Excel中被分析为多个表。

I wonder if it is possible to create an HTML file which contains multiple tables which will be parsed as multiple sheets in Excel.

这是这个文件的Excel视图:

Here is the Excel view of this file :

推荐答案

是的,这是可能的。

不过请记住,您可能没有某些功能/格式由于这种格式的限制。

Yes, it is possible.
However keep in mind that you might not have some features/formatting due to the limitations of this format.

您可以使用多个电子表格作为HTML保存Excel文档,然后对其进行反向工程,以确定您必须改变(很容易做到)。

You can save an Excel document with several spreadsheets as HTML, and then reverse engineer it to figure out which part you have to change (it is easy to do).

要使用多个电子表格作为html文档保存文档:文件>另存为>网页(* .htm,* .html)
这个缺点方法是它会产生几个文件。

To save a document with several spreadsheets as html document : File > Save As > Web Page (*.htm, *.html) The drawback of this method is that it will produce several files.

如果你想要一个唯一的文件,使用文件>另存为>单个文件网页(* .mht; * .mhl)
这将创建一个唯一的文件(.mht),您可以使用浏览器打开(大多数浏览器都打开这些文件)。

If you want a unique file, use File > Save As > Single File Web Page (*.mht; *.mhl) This will create a unique file (.mht) that you can open with a browser if you want (most browsers do open these files).

更多详细信息在 office.microsoft.com

编辑:我没有发布任何代码,因为它非常长(excel会自动将一些代码添加到文件中)
EDIT2:如果您正在创建一个程序来执行此操作,我建议您使用已有的库,例如< a href =https://code.google.com/p/excellibrary/ =nofollow> excellibrary

I did not post any code here since it is very long (excel automatically adds some code into the file) If you're creating a programm to do this, I would recommend that you use already existing libraries, such as excellibrary

这篇关于如何创建单个HTML文件在Excel中查看多张表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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