Skip to main content

I’m trying to suppress a whole paragraph containing a table in a Word template if table is empty. Is there a conditional tag that allows me to test on empty tables?

@JGalant   

  • Keep in mind that in a word Document, a paragraph typically does not “contain” a table.  In MS Word a Paragraph end marker would typically precede a a Table object and then if you had text following the table, that would be a separate paragraph (as highlighted in image). 
  • Using <# <Conditional Test=”//YourXpathExpression” /> #> and the matching <# <EndConditional/> #> to span the paragraphs and the tables in question should work (see red tags in image)
  • Keep in mind that Conditional Test is looking for a Boolean True for the area spanned to be ON, so if you wanted the Paragraph and table to be off when the table was empty, your Xpath would want to look for a condition where you would know your table was populated

     


Reply