Borders appearing when it seems like they shouldn't

Connor Shore 186 Reputation points
2022-08-31T20:19:30.797+00:00

Hello, I have a question about why the borders are being drawn in the attached word file. The table has borders set and you can see this in the document.xml:
236618-image.png

However, every single cell in the document.xml has borders specified to be none:
236694-image.png

Why do borders appear in the word document even though every cell has borders turned off? Does table style override borders that are explicitly specified as none?

Also as a side note, if you try to delete a cell from the table in the word document, then all the borders disappear.

HERE IS THE LINK TO THE DOCUMENT: https://windwardstudios.box.com/s/far9zbpc7e9djv71q8dguus5m9bsx7bf

Thank you!

Office Open Specifications
Office Open Specifications
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Open Specifications: Technical documents for protocols, computer languages, standards support, and data portability. The goal with Open Specifications is to help developers open new opportunities to interoperate with Windows, SQL, Office, and SharePoint.
122 questions
{count} votes

Accepted answer
  1. Mike Bowen 1,276 Reputation points Microsoft Employee
    2022-09-06T23:06:07.793+00:00

    Hi @Connor Shore ,

    For the first part of your questions: Why do borders appear in the word document even though every cell has borders turned off? Does table style override borders that are explicitly specified as none?

    In MS-OI29500 2.1.169 Part 1 Section 17.4.66, tcBorders (Table Cell Borders) it states:

    "If the conflicting table cell border is none (no border), then the opposing border shall be displayed. If the conflicting table cell border is nil, then no border shall be displayed."

    So, since the borders for the cells in the document are "none" the opposing border, in this case the table border, is displayed. If you set w:val="nil" on the cells then the borders won't display.

    Regarding why they disappear when you remove a cell. If you look at the underlying xml, when Word writes out the xml for the document.xml part it removes the <tcBorders> elements from the <w:tcPr> element of the cells. Since the cells don't have a <tcBorders> element anymore it defaults to the value in styles.xml. If you look at w:style with w:styleId="TableGrid", it shows that the default border is w:val="nil", which will hide the borders. If this is changed to "none" then the border will display.

    Please let me know if that answers your question.

    Best regards,
    Michael Bowen
    Microsoft Open Specifications Support

    0 comments No comments

0 additional answers

Sort by: Most helpful