<p>When you define a table field, it comes with one row by default. I'm not sure why this is. You can remove this row by clicking on the - icon: <img src="https://i.sstatic.net/yXBW3.png" alt="screen shot"></p>

<p>To filter out those rows in twig, try:</p>

<pre><code>{% for row in entry.discography if row.releaseName %}
</code></pre>

CC BY-SA 3.0
2015-07-21T20:53:03.593Z
Everyone gets one table row for free.  The rest will cost you.
Brad Bell
CC BY-SA 3.0
2015-07-21T20:45:35.320Z
2015-07-21T20:45:35.320Z
Marion Newlevant
<p>I'm doing, what I think should work fine, however, I'm still getting a blank table output on the page if the table field is left unfilled when creating the entry. It's like the "if" check is being ignored for some reason. The table with data outputs as expected fine. What am I missing here? Gotta be something simple. Here's a link to the page in question: <a href="http://nightowlmusic.org/family/rotiron" rel="nofollow">http://nightowlmusic.org/family/rotiron</a></p>

<pre><code>{% if entry.discography | length %}
        &lt;table class="discography"&gt;
            &lt;tr&gt;
                &lt;th colspan="3"&gt;Discography&lt;/th&gt;
            &lt;/tr&gt;
            {% for row in entry.discography %}
            &lt;tr&gt;
                &lt;td class="release"&gt;{{ row.releaseName }}&lt;/td&gt;
                &lt;td class="year"&gt;{{ row.releaseYear }}&lt;/td&gt;
                &lt;td class="purchaseLink"&gt;
                    {% if row.purchaseLink %}&lt;a href="{{ row.purchaseLink }}" title="Purchase the Release"&gt;Click here to purchase&lt;/a&gt;{% endif %}
                &lt;/td&gt;
            &lt;/tr&gt;
            {% endfor %}
        &lt;/table&gt;
{% endif %}
</code></pre>

CC BY-SA 3.0
2015-07-21T20:44:49.380Z
"...if the table field is left unfilled when creating the entry". Do you mean that you have no rows in your table? Or do you have one row, but none of the columns haven't been filled? By default, when creating a new table field in Craft, there is one row in the table. Can be a bit confusing. :)
André Elvan
CC BY-SA 3.0
2015-07-21T20:45:41.743Z
The columns have not been filled in.
Herb Himes
<table-field>
How do you not output table field if there are no values?
# How do you not output table field if there are no values?

(Asked by: username_0 on 2015-07-21)

I'm doing, what I think should work fine, however, I'm still getting a blank table output on the page if the table field is left unfilled when creating the entry. It's like the "if" check is being ignored for some reason. The table with data outputs as expected fine. What am I missing here? Gotta be something simple. Here's a link to the page in question: http://nightowlmusic.org/family/rotiron
{% if entry.discography | length %}
        
            
                Discography
            
            {% for row in entry.discography %}
            
                {{ row.releaseName }}
                {{ row.releaseYear }}
                
                    {% if row.purchaseLink %}Click here to purchase{% endif %}
                
            
            {% endfor %}
        
{% endif %}

**Tags:** table-field
> **Comments:**
> **username_1**: "...if the table field is left unfilled when creating the entry". Do you mean that you have no rows in your table? Or do you have one row, but none of the columns haven't been filled? By default, when creating a new table field in Craft, there is one row in the table. Can be a bit confusing. :)  
> **username_0**: The columns have not been filled in.  

---

## 1 answers

### Answer by username_2 on 2015-07-21. Score: 3 | Accepted answer

When you define a table field, it comes with one row by default. I'm not sure why this is. You can remove this row by clicking on the - icon: 
To filter out those rows in twig, try:
{% for row in entry.discography if row.releaseName %}

> **Comments:**
> **username_3**: Everyone gets one table row for free.  The rest will cost you.  

---

