Allow setting header row attributes in table.html.twig

Created on 13 February 2024, about 1 year ago
Updated 7 March 2024, about 1 year ago

Problem/Motivation

table.html.twig allows setting attributes on the tr elements inside tbody, but not the one inside thead. It would be useful to be able to do this.

Proposed resolution

#header is currently an array of cells. Make it so that if #header contains the key cells, then that is interpreted to be an array of cells and any values in the key row_attributes are added as attributes on the tr.

Remaining tasks

Agree on form of #header. Implement in table.html.twig and template_preprocess_table().

User interface changes

None.

API changes

Additional keys in #header.

Data model changes

None.

Release notes snippet

✨ Feature request
Status

Needs work

Version

11.0 🔥

Component
Theme  →

Last updated about 23 hours ago

Created by

🇨🇦Canada Liam Morland Ontario, CA 🇨🇦

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs change record

    A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024