Sha256: 8e3917a246c9b5d2af980c01be56caf26c93678bf3dc1f95aff8670afbb80b45

Contents?: true

Size: 1.14 KB

Versions: 325

Compression:

Stored size: 1.14 KB

Contents

<%
  caption ||= nil
  head ||= []
  rows ||= []
  first_cell_is_header ||=false
  caption_classes ||= nil
  sortable ||=false
%>

<%= GovukPublishingComponents::AppHelpers::TableHelper.helper(self, caption, {
    sortable: sortable,
    caption_classes: caption_classes
  }) do |t| %>

  <% if head.any? %>
    <%= t.head do %>
      <% head.each_with_index do |item, cellindex| %>
        <%= t.header item[:text], {
          format: item[:format],
          href: item[:href],
          data_attributes: item[:data_attributes],
          sort_direction: item[:sort_direction]
        } %>
      <% end %>
    <% end %>
  <% end %>

  <%= t.body do %>
    <% rows.each_with_index do |row, rowindex| %>
      <%= t.row do %>
        <% row.each_with_index do |cell, cellindex| %>
          <% if cellindex == 0 && first_cell_is_header %>
            <%= t.header cell[:text], {
              scope: "row",
              format: cell[:format]
            } %>
          <% else %>
            <%= t.cell cell[:text], {
              format: cell[:format]
            } %>
          <% end %>
        <% end %>
      <% end %>
    <% end %>
  <% end %>

<% end %>

Version data entries

325 entries across 325 versions & 1 rubygems

Version Path
govuk_publishing_components-29.14.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.13.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.12.1 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.12.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.11.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.10.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.9.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.8.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.7.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.6.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.5.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.4.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.3.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.2.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.1.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.0.1 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-29.0.0 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-28.9.2 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-28.9.1 app/views/govuk_publishing_components/components/_table.html.erb
govuk_publishing_components-28.9.0 app/views/govuk_publishing_components/components/_table.html.erb