Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Adding text to a cell in an xlsx OOXML file?

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?

like image 942
meds Avatar asked Oct 19 '25 13:10

meds


1 Answers

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>
like image 73
Skrol29 Avatar answered Oct 22 '25 03:10

Skrol29



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!