使用OpenXML SDK为合并单元格范围应用边框时,边框仅在合并范围的第一个(左上角)单元格中显示。我完全不知道原因,这让我感到非常疯狂。使用生产力工具,我找不到我生成的样式表和正常工作的样式表之间有任何有意义的区别。以下是我的样式表生成的XML代码:
<x:borders count="2" xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<x:border>
<x:left />
<x:right />
<x:top />
<x:bottom />
<x:diagonal />
</x:border>
<x:border>
<x:left />
<x:right />
<x:top />
<x:bottom style="thick">
<x:color auto="1" />
</x:bottom>
<x:diagonal />
</x:border>
</x:borders>
<x:cellXfs xmlns:x="http://schemas.openxmlformats.org/spreadsheetml/2006/main">
<x:xf fontId="0" />
<x:xf fontId="1" fillId="2" applyFont="1" applyFill="1" />
<x:xf borderId="1" applyBorder="1" />
</x:cellXfs>
我已经尝试了各种方法,例如在边框之前、之后等应用合并。