ss:AutoFitHeight是否适用于文本?

我有一个XML文件,保存为.xls在Excel中处理:

 <results> <result> <companyName>Fnatic</companyName> <serviceID>1045</serviceID> <startDate>01-01-2014 00:00:00</startDate> <endDate>01-02-2014 00:00:00</endDate> <hours>1</hours> <description>Couple of paragraphs of text. Like 3 of them.</description> </result> ... more results </results> 

我使用Excel XML来定义XML数据的结构和样式。 只剩下要做的事情就是将“说明”单元格(即合并的一组列)自动调整为其中的文本数量。 ss:Row似乎有ss:AutoFitHeight 。 但是,当我使用它们时,结果.xls文件没有发生变化。 ss:AutoFitHeight不能像ss:AutoFitWidth一样使用文本ss:AutoFitWidth不适用于ss:Column文本?

 ... rest of typical declarations <xsl:template match="results"> <Styles> <Style ss:ID="Default" ss:Name="Normal"> <Alignment ss:Vertical="Top" /> <Borders /> <Font /> <Interior /> <NumberFormat /> <Protection /> </Style> <Style ss:ID="s1"> <Font ss:Size="10" ss:Bold="1" /> <Interior ss:Color="#cef2ce" ss:Pattern="Solid" /> <Alignment ss:Horizontal="Right" ss:Vertical="Top" /> </Style> <Style ss:ID="s2"> <Interior ss:Color="#C0C0C0" ss:Pattern="Solid" /> </Style> </Styles> <Worksheet ss:Name="Worksheet"> <Table x:FullColumns="1" x:FullRows="1"> <Column ss:Width="77" /> <Column ss:Width="65" /> <Column ss:Width="246" /> <Column ss:Width="26" /> <xsl:apply-templates select="result" /> <Row><!-- Last Row --> <Cell ss:Index="3"><Data ss:Type="String">Total:</Data></Cell> <Cell ss:Formula="=SUM(R[-{count(result)}]C:R[-1]C)"> <Data ss:Type="Number"></Data> </Cell> </Row> </Table> </Worksheet> </xsl:template> <xsl:template match="result"> <Row> <xsl:apply-templates select="serviceID" /> <xsl:apply-templates select="hours" /> </Row> <Row ss:AutoFitHeight="1"> <xsl:apply-templates select="description" /> </Row> </xsl:template> <xsl:template match="serviceID"> <Cell ss:StyleID="s1"> <Data ss:Type="String">Service ID:</Data> </Cell> <Cell ss:StyleID="s2"> <Data ss:Type="Number"> <xsl:value-of select="."/> </Data> </Cell> </xsl:template> <xsl:template match="description"> <Cell ss:StyleID="s1"> <Data ss:Type="String">Description:</Data> </Cell> <Cell ss:MergeAcross="2"> <Data ss:Type="String"> <xsl:value-of select="."/> </Data> </Cell> </xsl:template> <xsl:template match="hours"> <Cell ss:StyleID="s1"> <Data ss:Type="String">Hours:</Data> </Cell> <Cell ss:StyleID="s2"> <Data ss:Type="Number"> <xsl:value-of select="."/> </Data> </Cell> </xsl:template> 

删除列属性上的默认行高是违反直觉的,似乎与规范相矛盾( https://msdn.microsoft.com/zh-cn/library/office/aa140066(v=office.10).aspx#odc_xmlss_ss:row ),但它有帮助。