Created
July 26, 2017 21:53
-
-
Save zomars/b9c0b60063536aad09d5b1b5d9053698 to your computer and use it in GitHub Desktop.
Print a table from Advanced Custom Fields: Table Field using Timber in Twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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