commit c434b296bdd50a00f7e868a3ffecda3efc68cf08 Author: Joel Pittet Date: Fri Apr 19 21:19:57 2013 -0700 remove nested reference forloop hack and fix whitespace diff --git a/core/modules/system/templates/table.html.twig b/core/modules/system/templates/table.html.twig index ba6c4c7..031e9a2 100644 --- a/core/modules/system/templates/table.html.twig +++ b/core/modules/system/templates/table.html.twig @@ -44,35 +44,25 @@ {% endif %} {# Columns #} - {% if colgroups %} - {% for colgroup in colgroups %} - {% if colgroup.cols %} - + {% for colgroup in colgroups %} + {% if colgroup.cols %} + {% for col in colgroup.cols %} - {# - Use temporary variable for column attributes. This somehow works - around the issue where columns after the first column do not receive - attributes. Try using col.attributes directly, and you'll see. - Is this a Twig or an Attribute() issue? - @see http://drupal.org/node/1867090 - #} - {% set col_attributes = col.attributes %} - + {% endfor %} - - {% else %} - - {% endif %} - {% endfor %} - {% endif %} + + {% else %} + + {% endif %} + {% endfor %} {# Header #} {% if header %} - {% for i in header|keys -%} - - {{- header[i].data -}} + {% for cell in header -%} + + {{- cell.data -}} {%- endfor %} @@ -84,10 +74,10 @@ {% for row in rows %} - {% for i in row.cells|keys -%} - {%- set cell_tag = row.cells[i].header ? 'th' : 'td' -%} - <{{ cell_tag }}{{ row.cells[i].attributes }}> - {{- row.cells[i].data -}} + {% for cell in row.cells -%} + {%- set cell_tag = cell.header ? 'th' : 'td' -%} + <{{ cell_tag }}{{ cell.attributes }}> + {{- cell.data -}} {%- endfor %}