We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Don't display a table when there are 0 rows

Hi there,


Building a word document that is made up of a series of tables. If there are zero rows returned in the data set for a certain table i’d like to hide the table and instead show a message. Is there a quick trick to doing this?
Hi Brendan,

Thanks for your inquiry. It would be great if you please share following detail for our reference. We will then provide you more information about your query along with code.

  • Please attach your input Word document.
  • Please create a standalone/runnable simple application (for example a Console Application Project) that demonstrates the code (Aspose.Words code) you used to generate your output document
  • Please attach the output Word file that contains the table which you want to hide.

This is very time consuming to do this and I don’t see why it would be necessary. Could you not just explain a way to hide a table?

Hi Brendan,

Thanks for your inquiry. You can use Table.Remove method to remove the table from the document. If you still face problem, please share the requested detail. We will then provide you more information on this along with code.