jfu-1.0.x-dev/templates/components/jfu_custom_table.html.twig
templates/components/jfu_custom_table.html.twig
<div class="custom-table-responsive">
<table>
{% if json_array.thead %}
<thead>
<tr>
{% for thead_item in json_array.thead %}
<th scope="col" class="">
{% include '@jfu/components/jfu_' ~ thead_item.type ~ '.html.twig' with {'json_array': thead_item } %}
</th>
{% endfor %}
</tr>
</thead>
{% endif %}
{% if json_array.tbody %}
<tbody>
{% for row in json_array.tbody.0.rows %}
{% set current = json_array.thead[loop.index].type ~ '.html.twig' %}
{% set current_head_item = json_array.thead[loop.index] %}
<tr>
{% for key, cell in row %}
<td {{ json_array.thead ? 'class="custom-table-flex"' }}>
{% if json_array.thead %}
<b class="custom-table-responsive--label">
{% include '@jfu/components/jfu_' ~ json_array.thead[''~loop.index0].type ~ '.html.twig' with {'json_array': json_array.thead[''~loop.index0] } %}
</b>
{% endif %}
<div class="custom-table--content">
{% include '@jfu/components/jfu_' ~ cell.type ~ '.html.twig' with {'json_array': cell } %}
</div>
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
{% endif %}
{% if json_array.tfoot %}
<tfoot>
{% for tfoot_item in json_array.tfoot %}
<td>
{% include '@jfu/components/jfu_' ~ tfoot_item.type ~ '.html.twig' with {'json_array': tfoot_item } %}
</td>
{% endfor %}
</tfoot>
{% endif %}
</table>
</div>
