Skip to content
Snippets Groups Projects
Commit bab3e170 authored by Olimpia Magliulo's avatar Olimpia Magliulo
Browse files

Add _table.twig

the template can be used in different templates.
It highlights rows differently if they're odd or even.
It has 2 flexible blocks that can be used to override a column or add other content.

Classes can be used to readapt it for a specific css framework.
parent f434f369
No related branches found
No related tags found
No related merge requests found
<table id="table_with_attributes" class="attributes" summary="attribute overview">
{% for name, values in items %}
<tr class="{{ cycle(['odd', 'even'], loop.index0) }}">
{% block namecol %}
<td class="attrname">{{ name }}</td>
{% endblock %}
<td class="attrvalue">
{% for value in values %}
{% if loop.length>1 and loop.first %}<ul>{% endif %}
{% if loop.length>1 %}<li>{% endif %}
{% block value %}{% endblock %}
{% if loop.length>1 %}</li>{% endif %}
{% if loop.length>1 and loop.last %}</ul>{% endif %}
{% endfor %}
</td>
</tr>
{% endfor %}
</table><br>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment