Merge pull request #1152 from alphagov/check-table-heading

Add helpful column heading for screenreader users
This commit is contained in:
Chris Hill-Scott
2017-02-23 16:45:22 +00:00
committed by GitHub
2 changed files with 4 additions and 2 deletions

View File

@@ -73,7 +73,7 @@
{% macro index_field(text) -%}
<td class="table-field-index">
<span class="visually-hidden">Row </span>{{ text }}
<span>{{ text }}</span>
</td>
{%- endmacro %}

View File

@@ -170,7 +170,9 @@
recipients.initial_annotated_rows_with_errors if row_errors and not recipients.missing_column_headers else recipients.initial_annotated_rows,
caption=original_file_name,
caption_visible=False,
field_headings=['1'] + recipients.column_headers
field_headings=[
'<span class="visually-hidden">Row in file</span><span aria-hidden="true">1</span>'|safe
] + recipients.column_headers
) %}
{{ index_field(item.index + 2) }}
{% for column in recipients.column_headers %}