HTML表格到XLS(用于公式的单元格) [英] HTML Table to XLS (Cell used for a formula)

查看:47
本文介绍了HTML表格到XLS(用于公式的单元格)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理HTML表,希望将其转换为XLS文件

I am doing an HTML table and I want it to be converted to XLS file

我正在使用此表为例

<table>
    <tr>
        <td>AUD</td>
        <td>200.00</td>
    </tr>
    <tr>
        <td>AUD</td>
        <td>200.00</td>
    </tr>
    <tr>
        <td>AUD</td>
        <td>200.00</td>
    </tr>
    <tr>
        <td>EUR</td>
        <td>300.00</td>
    </tr>
    <tr>
        <td>AUD</td>
        <td>200.00</td>
    </tr>
    <tr>
        <td>AUD</td>
        <td>200.00</td>
    </tr>
    <tr>
        <td>AUD</td>
        <td>200.00</td>
    </tr>
    <tr>
        <td>AUD</td>
        <td>**=SUM(A2:A10);**</td>
    </tr>
</table>

是否可以使用 = SUM(A2:A10); 作为公式而不是普通的纯文本来创建单元格?

Is there a way how I can create a cell with the =SUM(A2:A10); as a formula and not a normal plain text?

推荐答案

将html导入excel时,重要的是要知道有各种excel特定的属性,您可以使用它们来使excel表现得像您几乎可以满足任何业务需求.

When importing html to excel, it is important to know that there are a variety of excel-specific attributes that you can use to get excel to perform pretty much like you would expect it to, for nearly any business requirement.

您需要添加excel命名空间:

You'll need the excel namespaces added:

<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40">
</html>

然后您可以在表格单元格中创建公式:

And then you can create a formula in a table cell:

<td x:num x:fmla="=SUM(A2,A10)">0</td>

您可以在本文中了解有关正确实现这些功能的更多信息: http://www.c-sharpcorner.com/UploadFile/kaushikborah28/79Nick08302007171404PM/79Nick.aspx

You can read much more about properly implementing these capabilities in this article: http://www.c-sharpcorner.com/UploadFile/kaushikborah28/79Nick08302007171404PM/79Nick.aspx

这篇关于HTML表格到XLS(用于公式的单元格)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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