none
What's the difference between <tblPr> and <tblStylePr type='wholeTable'>? RRS feed

  • Question

  • Hi;

    It seems to me that building up the settings you first apply tblPr and then tblStylePr type='wholeTable', then the other tblStylePr settings.

    Since both of those apply to the entire table, why then need for tblStylePr type='wholeTable'? 17.7.6.6 says:

    When specified, these conditional formats shall be applied in the following order (therefore subsequent formats override properties on previous formats):

    Which means they are all applied.

    ??? - thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Sunday, March 20, 2016 11:59 PM

Answers

  • Hello Dave,

    We have verified that Word ignores conditional styles under the <w:tblStylePr w:type="wholeTable"> element. We are starting the document update process for this so that this behavior is described.

    Thanks,
    Kamil

    Thursday, April 14, 2016 7:36 PM

All replies

  • Hello Dave :

    Thank you for contacting Microsoft Support. A support engineer will be in touch by tomorrow  to assist further.

    Regards


    Tarun Chopra | Escalation Engineer | Open Specifications Support Team

    Monday, March 21, 2016 3:45 AM
  • Hello Dave,

    I'm looking into this for you.

    Thanks,
    Kamil

    Monday, March 21, 2016 5:37 PM
  • Hello Dave,

    As per the ISO/IEC 29500-1 specification:

    The 17.7.6.4 tblPr (Style Table Properties) element allows the definition of table properties that are always applied and are specific to tables such as cell spacing, borders etc.

    17.7.6.6 tblStylePr (Style Conditional Table Formatting Properties) elements allows the definition of table properties that are specific to tables (as above) but in addition to that, it can also define properties that are not table specific, such as paragraphs, runs etc.

    Please also see the following section that refers to the additional formatting:
    17.7.6 Table Styles
    "Table styles are style definitions which apply to the contents of zero or more tables within a document. This definition can imply that the style can only define table properties (properties which apply to the table and its constituent rows and cells), however a table style can also define paragraph properties (properties which apply to the positioning and appearance of paragraphs) as well as character properties (properties which apply to runs) for all of the paragraphs and runs within the specified table in the document. "

    By using the <tblStylePr type='wholeTable'> element, you could apply a paragraph style to all cells in the table, for example. Below are the relevant schemas for comparison. Note that for example the pPr element is only available in the CT_TblStylePr type.

    <xsd:complexType name="CT_TblStylePr">
    <xsd:sequence>
    <xsd:element name="pPr" type="CT_PPrGeneral" minOccurs="0"/>
    <xsd:element name="rPr" type="CT_RPr" minOccurs="0"/>
    <xsd:element name="tblPr" type="CT_TblPrBase" minOccurs="0"/>
    <xsd:element name="trPr" type="CT_TrPr" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="tcPr" type="CT_TcPr" minOccurs="0" maxOccurs="1"/>
    </xsd:sequence>
    <xsd:attribute name="type" type="ST_TblStyleOverrideType" use="required"/>
    </xsd:complexType>

    <xsd:complexType name="CT_TblPrBase">
    <xsd:sequence>
    <xsd:element name="tblStyle" type="CT_String" minOccurs="0"/>
    <xsd:element name="tblpPr" type="CT_TblPPr" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="tblOverlap" type="CT_TblOverlap" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="bidiVisual" type="CT_OnOff" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="tblStyleRowBandSize" type="CT_DecimalNumber" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="tblStyleColBandSize" type="CT_DecimalNumber" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="tblW" type="CT_TblWidth" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="jc" type="CT_JcTable" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="tblCellSpacing" type="CT_TblWidth" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="tblInd" type="CT_TblWidth" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="tblBorders" type="CT_TblBorders" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="shd" type="CT_Shd" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="tblLayout" type="CT_TblLayoutType" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="tblCellMar" type="CT_TblCellMar" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="tblLook" type="CT_TblLook" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="tblCaption" type="CT_String" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="tblDescription" type="CT_String" minOccurs="0" maxOccurs="1"/>
    </xsd:sequence>
    </xsd:complexType>

    Thanks,
    Kamil


    Tuesday, March 22, 2016 8:16 PM
  • Please take a look at the file TableStyles.docx. The first table has the font color set using a plain old table style and it works as expected.

    The second table sets the font color using tblStylePr for both firstRow and wholeTable. From what you wrote I expected wholeTable to also set the font color. It didn't. To add to the weirdness, firstRow is able to set the font color.

    In addition, according to your explanation above, it seems like a plain old table style does exactly the same thing as tblStylePr - wholeTable. They don't based on the uploaded document, but they should according to your post above.

    So what are the limits of wholeTable and why does it exist?

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Wednesday, March 23, 2016 7:18 PM
  • Hi David,

    Thanks for the example. I'm looking into this.

    Thanks,
    Kamil

    Thursday, March 24, 2016 1:45 PM
  • Hello David,

    Just a quick update:

    So far I have not been able to find a way to apply the conditional formatting under <w:tblStylePr w:type="wholeTable"> to the table style, even when using different flags under w:tblLook in the referencing table.

    We are looking into this further to see if this is a deviation from the specification.

    Thanks,
    Kamil

    Friday, April 1, 2016 2:24 PM
  • Hi Kamil;

    Any update? Is it possible Word ignores the wholeTable setting? It can as that's redundant with the base style settings.

    thanks - dave


    What we did for the last 6 months - Made the world's coolest reporting & docgen system even more amazing

    Friday, April 8, 2016 5:34 PM
  • Hello Dave,

    It does appear that Word is ignoring the wholeTable setting from my testing but we're still checking into it to make sure there are no nuances around the behavior.

    Thanks,
    Kamil

    Monday, April 11, 2016 12:39 PM
  • Hello Dave,

    We have verified that Word ignores conditional styles under the <w:tblStylePr w:type="wholeTable"> element. We are starting the document update process for this so that this behavior is described.

    Thanks,
    Kamil

    Thursday, April 14, 2016 7:36 PM