Replies: 3   Views: 331
Delete entire table if no data
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by rstoeber  · 07-12-2021 - 17:21

Sometimes our user has no data for the table in a template. In this case, the table is rendered anyway and will display one row of the variables. That is not an optimal result.

I see functions called removeTemplateVariable and deleteTemplateBlock, but I can't figure out if they will do what we need. And my tests so far have not been successful.

Is there a way to delete the table completely if no data available? Is there an example of this?