Skip to content

Commit

Permalink
Indent HTML for Table
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Jan 25, 2024
1 parent 4f1b888 commit 9497750
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions packages/govuk-frontend/src/govuk/components/table/template.njk
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,28 @@
</thead>
{% endif %}
<tbody class="govuk-table__body">
{% for row in params.rows %}
{% if row %}
<tr class="govuk-table__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 %} {{ attribute }}="{{ value }}"{% endfor %}
{% endset %}
{% if loop.first and params.firstCellIsHeader %}
<th scope="row" class="govuk-table__header {%- if cell.classes %} {{ cell.classes }}{% endif %}"
{{- commonAttributes | safe -}}
>{{ cell.html | safe if cell.html else cell.text }}</th>
{% else %}
<td class="govuk-table__cell
{%- if cell.format %} govuk-table__cell--{{ cell.format }}{% endif %}
{%- if cell.classes %} {{ cell.classes }}{% endif %}"
{{- commonAttributes | safe -}}
>{{ cell.html | safe if cell.html else cell.text }}</td>
{% endif %}
{% endfor %}
</tr>
{% for row in params.rows %}
{% if row %}
<tr class="govuk-table__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 %} {{ attribute }}="{{ value }}"{% endfor %}
{% endset %}
{% if loop.first and params.firstCellIsHeader %}
<th scope="row" class="govuk-table__header {%- if cell.classes %} {{ cell.classes }}{% endif %}"
{{- commonAttributes | safe -}}
>{{ cell.html | safe if cell.html else cell.text }}</th>
{% else %}
<td class="govuk-table__cell
{%- if cell.format %} govuk-table__cell--{{ cell.format }}{% endif %}
{%- if cell.classes %} {{ cell.classes }}{% endif %}"
{{- commonAttributes | safe -}}
>{{ cell.html | safe if cell.html else cell.text }}</td>
{% endif %}
{% endfor %}
</tr>
{% endif %}
{% endfor %}
</tbody>
</table>

0 comments on commit 9497750

Please sign in to comment.