{% macro govukTable(params) %} {% if params.caption %} {% endif %} {% if params.head %} {% for item in params.head %} {% endfor %} {% endif %} {% for row in params.rows %} {% if row %} {% for cell in row %} {% set commonAttributes %} {%- if cell.colspan %} colspan="{{ cell.colspan }}"{% endif %} {%- if cell.rowspan %} rowspan="{{ cell.rowspan }}"{% endif %}{% for attribute, value in (cell.attributes.items() if cell.attributes else {}.items()) %} {{ attribute }}="{{ value }}"{% endfor %} {% endset %} {% if loop.first and params.firstCellIsHeader %} {% else %} {% endif %} {% endfor %} {% endif %} {% endfor %}
{{ params.caption }}
{{ item.html |safe if item.html else item.text }}
{{ cell.html | safe if cell.html else cell.text }}{{ cell.html | safe if cell.html else cell.text }}
{% endmacro %}