You are here

views-view-megarow-table.html.twig in Views Megarow 8

Default theme implementation for displaying a view as a table.

Available variables:

  • attributes: Remaining HTML attributes for the element.

    • class: HTML classes that can be used to style contextually through CSS.
  • title : The title of this group of rows.
  • header: The table header columns.
    • attributes: Remaining HTML attributes for the element.
    • content: HTML classes to apply to each header cell, indexed by

    the header's key.

  • caption_needed: Is the caption tag needed.
  • caption: The caption for this table.
  • accessibility_description: Extended description for the table details.
  • accessibility_summary: Summary for the table details.
  • rows: Table row items. Rows are keyed by row number.
    • attributes: HTML classes to apply to each row.
    • columns: Row column items. Columns are keyed by column number.
      • attributes: HTML classes to apply to each column.
      • content: The column content.

File

views-view-megarow-table.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for displaying a view as a table.
  5. *
  6. * Available variables:
  7. * - attributes: Remaining HTML attributes for the element.
  8. * - class: HTML classes that can be used to style contextually through CSS.
  9. * - title : The title of this group of rows.
  10. * - header: The table header columns.
  11. * - attributes: Remaining HTML attributes for the element.
  12. * - content: HTML classes to apply to each header cell, indexed by
  13. * the header's key.
  14. * - caption_needed: Is the caption tag needed.
  15. * - caption: The caption for this table.
  16. * - accessibility_description: Extended description for the table details.
  17. * - accessibility_summary: Summary for the table details.
  18. * - rows: Table row items. Rows are keyed by row number.
  19. * - attributes: HTML classes to apply to each row.
  20. * - columns: Row column items. Columns are keyed by column number.
  21. * - attributes: HTML classes to apply to each column.
  22. * - content: The column content.
  23. *
  24. * @see template_preprocess_views_view_table()
  25. *
  26. * @ingroup themeable
  27. */
  28. #}bbbbb
  29. <table{{ attributes }}>
  30. {% if caption_needed %}
  31. <caption>
  32. {% if caption %}
  33. {{ caption }}
  34. {% else %}
  35. {{ title }}
  36. {% endif %}
  37. {% if (summary is not empty) or (description is not empty) %}
  38. <details>
  39. {% if summary is not empty %}
  40. <summary>{{ summary }}</summary>
  41. {% endif %}
  42. {% if description is not empty %}
  43. {{ description }}
  44. {% endif %}
  45. </details>
  46. {% endif %}
  47. </caption>
  48. {% endif %}
  49. {% if header %}
  50. <thead>
  51. <tr>
  52. {% for column in header %}
  53. <th{{ column.attributes }} scope="col">
  54. {{ column.content }}
  55. </th>
  56. {% endfor %}
  57. </tr>
  58. </thead>
  59. {% endif %}
  60. <tbody>
  61. {% for row in rows %}
  62. <tr{{ row.attributes }}>
  63. {% for column in row.columns %}
  64. <td{{ column.attributes }}>
  65. {{ column.content }}
  66. </td>
  67. {% endfor %}
  68. </tr>
  69. {% endfor %}
  70. </tbody>
  71. </table>