Don't wrap TableBlock rendering in a div - fixes #2629

pull/2632/head
Matt Westcott 2016-05-18 12:28:56 +01:00
rodzic f8d7970cbb
commit 8ed30060fd
2 zmienionych plików z 40 dodań i 42 usunięć

Wyświetl plik

@ -1,9 +1,26 @@
<div class="table">
<table>
{% if table_header %}
<thead>
<tr>
{% for column in table_header %}
<table>
{% if table_header %}
<thead>
<tr>
{% for column in table_header %}
<th>
{% if column.strip %}
{% if html_renderer %}
{{ column.strip|safe|linebreaksbr }}
{% else %}
{{ column.strip|linebreaksbr }}
{% endif %}
{% endif %}
</th>
{% endfor %}
</tr>
</thead>
{% endif %}
<tbody>
{% for row in data %}
<tr>
{% for column in row %}
{% if first_col_is_header and forloop.first %}
<th>
{% if column.strip %}
{% if html_renderer %}
@ -13,38 +30,19 @@
{% endif %}
{% endif %}
</th>
{% endfor %}
</tr>
</thead>
{% endif %}
<tbody>
{% for row in data %}
<tr>
{% for column in row %}
{% if first_col_is_header and forloop.first %}
<th>
{% if column.strip %}
{% if html_renderer %}
{{ column.strip|safe|linebreaksbr }}
{% else %}
{{ column.strip|linebreaksbr }}
{% endif %}
{% endif %}
</th>
{% else %}
<td>
{% if column.strip %}
{% if html_renderer %}
{{ column.strip|safe|linebreaksbr }}
{% else %}
{{ column.strip|linebreaksbr }}
{% endif %}
{% else %}
<td>
{% if column.strip %}
{% if html_renderer %}
{{ column.strip|safe|linebreaksbr }}
{% else %}
{{ column.strip|linebreaksbr }}
{% endif %}
</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
</td>
{% endif %}
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>

Wyświetl plik

@ -21,7 +21,7 @@ def get_test_html_from_value(value):
that's what we expect from the TableBlock.
"""
data = list(value['data']) # Make a copy
table = '<div class="table"><table>'
table = '<table>'
if value['first_row_is_table_header']:
row_header = data.pop(0)
table += '<thead><tr>'
@ -39,7 +39,7 @@ def get_test_html_from_value(value):
table += '<td>%s</td>' % tiny_escape(col)
first = False
table += '</tr>'
table += '</tbody></table></div>'
table += '</tbody></table>'
return table