Module: CCS::FrontendHelpers::GovUKFrontend::Table
- Included in:
- CCS::FrontendHelpers::GovUKFrontend
- Defined in:
- lib/ccs/frontend_helpers/govuk_frontend/table.rb
Overview
GOV.UK Table
This helper is used for generating the table component from the GDS - Components - Table
Instance Method Summary collapse
-
#govuk_table(head_cells_or_rows, rows = nil) ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Table component.
Instance Method Details
#govuk_table(head_cells_or_rows, rows = nil) ⇒ ActiveSupport::SafeBuffer
Generates the HTML for the GOV.UK Table component
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ccs/frontend_helpers/govuk_frontend/table.rb', line 22 def govuk_table(head_cells_or_rows, rows = nil, **) if rows.nil? rows = head_cells_or_rows head_cells = nil else head_cells = head_cells_or_rows end Components::GovUK::Table.new(context: self, rows: rows, head_cells: head_cells, **).render end |