将文本添加到 xlsx OOXML 文件中的单元格?

发布于 2024-12-23 07:01:14 字数 316 浏览 1 评论 0原文

我一直在查看 excel 生成的一些 xml 文件,并发现定义单元格的内容时,它会执行如下操作:

<c r="ABC" t="s">
<t>1</t>
</c>

其中在其他地方引用了共享字符串.xml 文件。

那么我的问题是,是否可以将文本内容直接放在标签内?像这样:

<c>
<text>ABC</text>
</c>

或者我总是需要引用外部共享字符串 xml 文件?

I've been looking at some of the xml files excel generates and have found to define the contents of a cell it does something like this:

<c r="ABC" t="s">
<t>1</t>
</c>

Where the is referencing a sharedString.xml file elsewhere.

So my question is, is it possible to put the text content directly inside the tags? Like so:

<c>
<text>ABC</text>
</c>

Or do I always need to reference an external shared strings xml file?

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

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

发布评论

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

评论(1

爱她像谁 2024-12-30 07:01:14

其中引用其他地方的sharedString.xml 文件。

它位于子文件“xl/sharedStrings.xml”中。 “t”元素内的值是“xl/sharedStrings.xml”中“si”元素的索引(第一个索引为 0)。

是否可以将文本内容直接放在标签内?

是的,像这样:

  <c r="ABC" t="inlineStr">
    <is>
      <t>Here is the text directly in the cell</t>
    </is>
  </c>

Where the is referencing a sharedString.xml file elsewhere.

It is in the subfile "xl/sharedStrings.xml". The value inside the "t" element is the index of the "si" element in "xl/sharedStrings.xml" (first index is 0).

is it possible to put the text content directly inside the tags?

Yes, like this:

  <c r="ABC" t="inlineStr">
    <is>
      <t>Here is the text directly in the cell</t>
    </is>
  </c>
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文