Breaking down XLSX file structure : Part1 -styles.xml

<?xml version=”1.0″ encoding=”UTF-8″ standalone=”yes”?>
<styleSheet xmlns=”http://schemas.openxmlformats.org/spreadsheetml/2006/main” xmlns:x14ac=”http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac” xmlns:mc=”http://schemas.openxmlformats.org/markup-compatibility/2006″>
<fontscount=”2″>
<font>
<szval=”10.0″/>
<colorrgb=”FF000000″/>
<nameval=”Arial”/>
</font>
<font>
<colortheme=”1″/>
<nameval=”Arial”/>
</font>
</fonts>
<fillscount=”2″>
<fill>
<patternFillpatternType=”none”/>
</fill>
<fill>
<patternFillpatternType=”lightGray”/>
</fill>
</fills>
<borderscount=”1″>
<border/>
</borders>
<cellStyleXfs count=”1″>
<xf borderId=”0″fillId=”0″fontId=”0″numFmtId=”0″applyAlignment=”1″applyFont=”1″/>
</cellStyleXfs>
<cellXfs count=”2″>
<xf borderId=”0″fillId=”0″fontId=”0″numFmtId=”0″xfId=”0″applyAlignment=”1″applyFont=”1″>
<alignmentreadingOrder=”0″shrinkToFit=”0″vertical=”bottom”wrapText=”0″/>
</xf>
<xf borderId=”0″fillId=”0″fontId=”1″numFmtId=”0″xfId=”0″applyAlignment=”1″applyFont=”1″>
<alignmentreadingOrder=”0″/>
</xf>
</cellXfs>
<cellStyles count=”1″>
<cellStyle xfId=”0″name=”Normal”builtinId=”0″/>
</cellStyles>
<dxfs count=”0″/>
</styleSheet>

When you unzip a xlsx file, you’d notice there’s a file named styles.xml.This is the file handles the style of the cells. There are a lot of tags in there, the tag cellXfs is the part actually determines each cell’s style. When you want to give a name to a format, then use the tag cellStyleXfs instead. If you want to know more, the following link would help you.

Reference URL
Microsoft Official Doc

Leave a Reply

Your email address will not be published. Required fields are marked *