<p>Is this what you're after?</p>

<pre><code>{% for row in block.tableHandle %}

    {% for columnHandle, columnValue in row %}
        {# If not col1 #}
        {% if loop.index != 1 %}
            &lt;p&gt;Do whatever you want with: {{ columnValue }}&lt;/p&gt;
        {% endif %}
    {% endfor %}

{% endfor %}
</code></pre>

CC BY-SA 3.0
2017-09-03T22:29:08.173Z
2017-09-03T22:29:08.173Z
Wei
<p>I'm not 100% sure I'm following the question, but if you just want to output every <code>col2</code> and <code>col4</code> row value, it'd be as simple as:</p>

<pre><code>&lt;ul&gt;
    {% for row in block.tableHandle %}
        &lt;li data-feature="{{ row.description }}"&gt;{{ row.col2 }} - {{ row.col4 }}&lt;/li&gt;
    {% endfor %}
&lt;/ul&gt;
</code></pre>

<p>There isn't a native way to loop directly by a column's handle.</p>

CC BY-SA 3.0
2017-08-04T16:03:32.500Z
I want to loop by column. Output all rows in column col2, all rows for col3 and all rows in col4 but in a loop. I don't want to repeat the codes 3 times.
NovoWeb
CC BY-SA 3.0
2017-08-03T19:03:55.907Z
2017-08-04T19:48:35.970Z
2017-08-04T19:48:35.970Z
Brad Bell
<p>How can I loop from col2 to col4 ? Or loop by column heading handle?
Remplace {{ row.<strong><em>col2</em></strong> }}</p>

<pre><code>&lt;ul class="features small-font-size"&gt;
  {% for row in block.tableHandle %}

      &lt;li data-feature="{{ row.description }}"&gt;{{ row.col2 }}&lt;/li&gt;

  {% endfor %}
&lt;/ul&gt;
</code></pre>

<loop><table-field><table>
Loop by column from a table
# Loop by column from a table

(Asked by: username_0 on 2017-08-03)

How can I loop from col2 to col4 ? Or loop by column heading handle?
Remplace {{ row.col2 }}

  {% for row in block.tableHandle %}

      {{ row.col2 }}

  {% endfor %}

**Tags:** loop, table-field, table


---

## 2 answers

### Answer by username_1 on 2017-09-03. Score: 1

Is this what you're after?
{% for row in block.tableHandle %}

    {% for columnHandle, columnValue in row %}
        {# If not col1 #}
        {% if loop.index != 1 %}
            Do whatever you want with: {{ columnValue }}
        {% endif %}
    {% endfor %}

{% endfor %}


---

### Answer by username_2 on 2017-08-03. Score: 0

I'm not 100% sure I'm following the question, but if you just want to output every col2 and col4 row value, it'd be as simple as:

    {% for row in block.tableHandle %}
        {{ row.col2 }} - {{ row.col4 }}
    {% endfor %}


There isn't a native way to loop directly by a column's handle.

> **Comments:**
> **username_0**: I want to loop by column. Output all rows in column col2, all rows for col3 and all rows in col4 but in a loop. I don't want to repeat the codes 3 times.  

---

