When using the OpenXML SDK to apply a border to a merged cell range, the border is displayed only for the first (upper left) cell in the merge range. I have no idea, and it drives me crazy. Using a productivity tool, I canβt find any meaningful difference in what I have and something that works as expected. This is my generated XML for the stylesheet:
<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>
I tried everything, applying merge to the border, after, etc.
source share