验证(CSS 2.0):“mso-number-format”不是已知的 CSS 属性名称

发布于 2024-10-02 11:42:32 字数 171 浏览 0 评论 0原文

我继承了一个 ASP .Net 应用程序来进行维护,其中包括将 HTML 表导出到 Excel。 HTML 包含如下结构: 构建代码时,我收到错误:“验证 (CSS 2.0): 'mso-number-format' 不是已知的 CSS 属性名称。” 有什么建议吗?

I have inherited for maintenance an ASP .Net app, which among other things exports HTML table to Excel. The HTML contains constructs like this one: <td style="mso-number-format:\@;">
When code is being built, I get error: “Validation (CSS 2.0): 'mso-number-format' is not a known CSS property name.”
Any suggestions?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

最近可好 2024-10-09 11:42:32

mso-number-format 是专有(读取:非标准(读取:garbage-outside-msoffice))Microsoft Office CSS 属性。您需要从导出中删除这些内容,或者最好将它们从 HTML 模板中完全删除。

我发现了一个关于该主题的很棒的资源,似乎与您的问题直接相关:http://agoric.com/ resources/software/htmltoExcel 显然他们支持这个属性。

mso-number-format is a proprietary (read: non-standard (read: garbage-outside-msoffice)) Microsoft Office CSS property. You will need to strip these from the export, or better yet remove them from the HTML template altogether.

I found a great resource on the subject that seems to pertain directly to your issue: http://agoric.com/sources/software/htmltoExcel Apparently they are in favor of the property.

方圜几里 2024-10-09 11:42:32

看起来我已经找到了我的问题的答案。问题不在于属性“mso-number-format”,而在于 Visual Studio 2008 处理它的方式。该属性是非标准的,因此验证投诉是合法的。但是,这不应妨碍项目的成功建设。

默认情况下,Visual Studio 2008 应将 HTML 和 CSS 错误视为警告。然而,显然存在一些安装故障。因此,VS2008可能会将HTML和CSS错误视为错误。修复位于:工具 | 选项 | 文本编辑器 | HTML | 验证。对于您的目标,应选中显示错误作为警告(HTML、CSS)复选框。就我而言,它们是,但错误被视为错误而不是警告。我取消选中这些框并单击确定。然后我导航回同一位置并再次检查它们并单击确定。这样就解决了问题。

It looks like I have found the answer to my question. The problem is not with the property 'mso-number-format', but with the way Visual Studio 2008 was treating it. The property is non-standard and therefore the validation complaint is legitimate. However, it should not prevent the project from successfully building.

Visual Studio 2008 by default should treat HTML and CSS errors as warnings. However, apparently there is some installation glitch. So, VS2008 may treat HTML and CSS errors as errors. The fix is in: Tools | Options | Text Editor | HTML | Validation. For your Target check boxes Show errors and as warnings (HTML, CSS) should be checked. In my case they were, but errors were treated as errors and not as warnings. I unchecked the boxes and clicked OK. Then I navigated back to the same place and checked them again and clicked OK. That took care of the problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文