locked
Where is the table border width (wx:bdrwidth) stored in the OpenXML format? RRS feed

  • Question


  • Greetings!

    So I created a table with a bottom border of thickness "3" and saved it in the Word 2003 XML (e.g. wordML) format, and this is the relevant part of the WordML (notice specifically this part wx:bdrwidth="60") :

    <w:tblBorders>

    <w:top w:val="single" w:sz="24" wx:bdrwidth="60" w:space="0" w:color="000000"/>

    <w:bottom w:val="single" w:sz="24" wx:bdrwidth="60" w:space="0" w:color="000000"/>

    </w:tblBorders>




    Now when I do the same exact thing in Word 2010 and save it in OpenXML, the relevant part of the OpenXML looks like:

    <w:tblBorders>
    <w:top w:val="single" w:sz="24" w:space="0" w:color="000000"/>
    <w:bottom w:val="single" w:sz="24" w:space="0" w:color="000000"/>
    </w:tblBorders>




    So as you can see above, there is no  wx:bdrwidth="60".
    So where is the border width stored?!

    So I inspected the entire open XML output and couldn't find where it stores the border width information.  Am I missing something?  Can someone please point me in the direction of where this information is stored, I need to do an XSLT to HTML and I need to know the border widths to render appropriately but can't find them.

    Thank you in advance,

    I am posting this in the word dev forum because this appears to be a change in functionality from Word 2003 and I wanted to confirm if that was indeed the case.

    Khalid K.


    Khalid K.

    Tuesday, June 4, 2013 6:18 PM

Answers

  • Both Word 2003 and later versions should use the value "w:sz=24" which is the border width in 1/8 point units, i.e. 3 points. The "wx:bdrwidth" value is in twips. I always understood that Word 2003 would use the w:sz rather than the wx:bdrwidth. As far as I know, the idea of the wx "AuxHint" namespace was to provide "hints" about various document features for non-Word XML processors. Perhaps it was believed that a value in twips would be more useful - I do not know.

    Peter Jamieson


    • Edited by Peter Jamieson Wednesday, June 5, 2013 10:51 AM clarification
    • Marked as answer by Khalid K_ Wednesday, June 5, 2013 8:04 PM
    Wednesday, June 5, 2013 7:43 AM

All replies

  • Both Word 2003 and later versions should use the value "w:sz=24" which is the border width in 1/8 point units, i.e. 3 points. The "wx:bdrwidth" value is in twips. I always understood that Word 2003 would use the w:sz rather than the wx:bdrwidth. As far as I know, the idea of the wx "AuxHint" namespace was to provide "hints" about various document features for non-Word XML processors. Perhaps it was believed that a value in twips would be more useful - I do not know.

    Peter Jamieson


    • Edited by Peter Jamieson Wednesday, June 5, 2013 10:51 AM clarification
    • Marked as answer by Khalid K_ Wednesday, June 5, 2013 8:04 PM
    Wednesday, June 5, 2013 7:43 AM
  • Hi Khalid

    You might check whether this information is stored in the TABLE STYLE which has been applied to the table.

    By default, Word 2007 and later will apply a table style to a table. I believe that was not the case in Word 2003, although that is the version in which table styles were introduced.

    One major difference between WordProcessingML (2003) and WordOpenXML (2007 and later) is that all the information that defined a document was stored in the single xml file. In the *.docx file format the information is stored in many xml documents that make up the ZIP package. So it's not said that everything will be in a single xml file.


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, June 5, 2013 9:57 AM
  • Peter,

    Thank you.  It appears that indeed wx:bdrwidth is no longer used in Word 2010, and instead it uses the w:sz component.  It was a bit confusing because in Word 2003 both of these were used, as can be seen in the above WordML snippet.

    This site was also helpful:

    http://www.schemacentral.com/sc/ooxml/search.html

    It confirmed that the w:sz is in 1/8 point units versus the wx:bdrwidth which was in 1/20 point units.


    Khalid K.

    Wednesday, June 5, 2013 8:04 PM