Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Print a table from Advanced Custom Fields: Table Field using Timber in Twig
{% if table %}
<table>
{% if table.header %}
<thead>
<tr>
{% for th in table.header %}
<th>{{ th.c }}</th>
{% endfor %}
</tr>
</thead>
{% endif %}
<tbody>
{% for tr in table.body %}
<tr>
{% for td in tr %}
<td>{{ td.c }}</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment