Вопрос

I am creating a table in MS Word the table looks like as shown below .

  1. Word Table
  2. I then ZIP the file and open the document.xml and check for the border elements in the table grid . this is how it looks . I am checking the for border element that is the top border element. Document table contents

  3. All the border are displayed as none . Then i check the TableGrid in the styles.xml file for table borders below is how the TableGrid styles look like in the styles.xml enter image description here

The problem here is i am not able to find where exactly is the border element getting assigned. The top black line in the table ?

Это было полезно?

Решение

Borders can be defined at table level via TableStyle (here w:tblBorders in TableGrid style) or via tablesProperties (here w:tblBorders in w:tblPr).

If both of them are definied, there is a conflict and borders definied via tablesProperties will win.

Since the w:tblBorders in w:tblPr are set to None, there is no borders.

But I noticed that TopBorder is missing here (you have Left, Right, Bottom InsideH and InsideV),

It's why, for the TopBorder, MS Word is using the TopBorder definied in TableGrid style and it is set to Single.

So, to remove the top border, you have to :

  • add the TopBorder which is missing in w:tblBorders in w:tblPr (and set it to none like others)
  • Or set the borders to None in the TableGrid style.
Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top