Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootstrap4: fix <tr scope="row"> issue in template #691

Merged
merged 1 commit into from
Sep 17, 2019
Merged

Conversation

vlt
Copy link
Contributor

@vlt vlt commented Sep 16, 2019

The scope attribute doesn't seem to be valid in a
element.

The problem was introduced in the WIP commit
7a0518d:

diff --git a/django_tables2/templates/django_tables2/bootstrap.html b/django_tables2/templates/django_tables2/bootstrap4.html
index feaf220..6cc1487 100644
--- a/django_tables2/templates/django_tables2/bootstrap.html
+++ b/django_tables2/templates/django_tables2/bootstrap4.html
@@ -25,7 +25,7 @@
                 <tbody {{ table.attrs.tbody.as_html }}>
                 {% for row in table.paginated_rows %}
                     {% block table.tbody.row %}
-                    <tr {{ row.attrs.as_html }}>
+                    <tr scope="row" {{ row.attrs.as_html }}>
                         {% for column, cell in row.items %}
                             <td {{ column.attrs.td.as_html }}>{% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %}</td>
                         {% endfor %}

The `scope` attribute doesn't seem to be valid in a <tr>
element.

The problem was introduced in the WIP commit
7a0518d:

diff --git a/django_tables2/templates/django_tables2/bootstrap.html b/django_tables2/templates/django_tables2/bootstrap4.html
index feaf220..6cc1487 100644
--- a/django_tables2/templates/django_tables2/bootstrap.html
+++ b/django_tables2/templates/django_tables2/bootstrap4.html
@@ -25,7 +25,7 @@
                 <tbody {{ table.attrs.tbody.as_html }}>
                 {% for row in table.paginated_rows %}
                     {% block table.tbody.row %}
-                    <tr {{ row.attrs.as_html }}>
+                    <tr scope="row" {{ row.attrs.as_html }}>
                         {% for column, cell in row.items %}
                             <td {{ column.attrs.td.as_html }}>{% if column.localize == None %}{{ cell }}{% else %}{% if column.localize %}{{ cell|localize }}{% else %}{{ cell|unlocalize }}{% endif %}{% endif %}</td>
                         {% endfor %}
@jieter
Copy link
Owner

jieter commented Sep 17, 2019

Ah, I must have applied the <th scope="row"> in https://getbootstrap.com/docs/4.3/content/tables/#examples as <tr scope="row=">, which doesn't make sense now.

Thanks!

@jieter jieter merged commit 8a41a53 into jieter:master Sep 17, 2019
@jieter
Copy link
Owner

jieter commented Sep 23, 2019

released 2.1.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants