Title: Hide table rows if empty
Last modified: August 31, 2016

---

# Hide table rows if empty

 *  [firstusadata](https://wordpress.org/support/users/firstusadata/)
 * (@firstusadata)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/hide-table-rows-if-empty/)
 * Is there any way to hide rows in a table if that row is empty? We have a form
   where the user can enter the number of vendors they work with. I would like to
   be able to create a table on the PDF that displays a number of rows dependent
   on how many vendors the user inputs. So if the user enters five vendors, the 
   table will have five rows, twenty vendors, the table will have twenty rows.
 * Is there a way to accomplish this on the PDF with PHP code?
    Any help would be
   appreciated.
 * Thank you,
 * [https://wordpress.org/plugins/gravity-forms-pdf-extended/](https://wordpress.org/plugins/gravity-forms-pdf-extended/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Jake Jackson](https://wordpress.org/support/users/blue-liquid-designs/)
 * (@blue-liquid-designs)
 * [10 years, 2 months ago](https://wordpress.org/support/topic/hide-table-rows-if-empty/#post-7183152)
 * This can be accomplished in a custom PDF template.
 * If you use a List field empty rows are automatically removed for you, but if 
   you just have 5 fields repeated 20 times I’d recommend placing them all in an
   array you can loop through. Then it’s just a matter of checking all the fields
   are empty in that array item and skip that row in the table.

Viewing 1 replies (of 1 total)

The topic ‘Hide table rows if empty’ is closed to new replies.

 * ![](https://ps.w.org/gravity-forms-pdf-extended/assets/icon-256x256.png?rev=3168987)
 * [Gravity PDF](https://wordpress.org/plugins/gravity-forms-pdf-extended/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gravity-forms-pdf-extended/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gravity-forms-pdf-extended/)
 * [Active Topics](https://wordpress.org/support/plugin/gravity-forms-pdf-extended/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gravity-forms-pdf-extended/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gravity-forms-pdf-extended/reviews/)

## Tags

 * [gravitypdf](https://wordpress.org/support/topic-tag/gravitypdf/)
 * [pdf](https://wordpress.org/support/topic-tag/pdf/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * 1 reply
 * 2 participants
 * Last reply from: [Jake Jackson](https://wordpress.org/support/users/blue-liquid-designs/)
 * Last activity: [10 years, 2 months ago](https://wordpress.org/support/topic/hide-table-rows-if-empty/#post-7183152)
 * Status: not resolved