-
Notifications
You must be signed in to change notification settings - Fork 586
Closed
Description
Describe the bug
When opening a Word document using the Open-XML-SDK, the TableBorders element within the TableProperties (<w:tblPr>) is missing from the parsed document structure.
Screenshots
If applicable, add screenshots to help explain your problem.
To Reproduce
- Create a Word document (.docx) with a table that includes TableBorders defined within the TableProperties.
- Open the document using the Open-XML-SDK with the following code:
using (WordprocessingDocument wordDoc = WordprocessingDocument.Open(stream, false))
{
Body body = wordDoc.MainDocumentPart.Document.Body;
Console.WriteLine(body.OuterXml);
}- Inspect the OuterXml of the Body element.
Observed behavior
The TableBorders element is missing from the TableProperties in the parsed document structure. The TableProperties appear as follows:
<w:tblPr>
<w:tblStyle w:val="TableGrid"/>
<w:tblW w:w="0" w:type="auto"/>
<w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/>
</w:tblPr>Expected behavior
The TableBorders element should be present within the TableProperties (<w:tblPr>) in the parsed document structure.
Document Example
<w:tblPr>
<w:tblStyle w:val="TableGrid"/>
<w:tblW w:w="0" w:type="auto"/>
<w:tblBorders>
<w:top w:val="thinThickThinSmallGap" w:sz="24" w:space="0" w:color="auto"/>
<w:left w:val="thinThickThinSmallGap" w:sz="24" w:space="0" w:color="auto"/>
<w:bottom w:val="thinThickThinSmallGap" w:sz="24" w:space="0" w:color="auto"/>
<w:right w:val="thinThickThinSmallGap" w:sz="24" w:space="0" w:color="auto"/>
<w:insideH w:val="thinThickThinSmallGap" w:sz="24" w:space="0" w:color="auto"/>
<w:insideV w:val="thinThickThinSmallGap" w:sz="24" w:space="0" w:color="auto"/>
</w:tblBorders>
<w:tblLook w:val="04A0" w:firstRow="1" w:lastRow="0" w:firstColumn="1" w:lastColumn="0" w:noHBand="0" w:noVBand="1"/>
</w:tblPr>Desktop (please complete the following information):
- OS: Windows 10/11
- .NET Target: .NET Core 9
- DocumentFormat.OpenXml Version: 3.3.0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels