How to correctly output a Table Field? I have set up a Matrix field with three blocks, each contains a Table field.

Each table has one column - a single line text field.

When I call these tables into the template with this code, each row is echoed twice:

{% for block in entry.projectFacts.limit(3) %}
    &lt;div class="panel panel-default"&gt;
    {% switch block.type %}
        {% case 'code' %}
            {% if block.codePoints | length %}
                &lt;ul&gt;
                    {% for items in block.codePoints %}

                        /* Outputs "Array" */
                        {{ items }}

                        {% for wtf in items %}
                            /* Outputs identical content &amp; wrapper twice */
                            &lt;li&gt;{{ wtf }}&lt;/li&gt;
                        {% endfor %}

                    {% endfor %}
                &lt;/ul&gt;
            {% endif %}
    &lt;/div&gt;
{% endfor %}


I'd be delighted if someone were able to point out what I need to do differently.
I suppose in your example codePoints is the actual Table field.

In order to output the table rows, the template should look like this:

{% if block.codePoints | length %}
    &lt;ul&gt;
    {% for row in block.codePoints %}
         {# Assuming 'text' is the column handle of the text field #}
        &lt;li&gt;{{ row.text }}&lt;/li&gt; 
    {% endfor %}
    &lt;/ul&gt;
{% endif %}


You get a double output because every row contains an array containing each table field twice, it looks like this:

array(2) { ["col1"]=&gt; string(4) "Some" ["text"]=&gt; string(4) "Some" }


That's why when loop over items you get every text twice.

I hope this helps.