Add functionality to {{ tp_select_data() }} to add <th> HTML tag to tables.

Created on 1 April 2025, 24 days ago

Problem/Motivation

Currently, the {{ tp_table_data() }} function generates placeholder table data using <td> elements only. There is no option to generate <th> elements for headers, which limits its usefulness when creating tables that require headers.

Steps to reproduce

1. Install and enable the twig_placeholders module.
2. In a Twig template, use {{ tp_table_data() }} within a table component.
3. Observe that all cells are wrapped in <td> tags, with no option for headers <th>.

Proposed resolution

Add functionality to also allow <th> HTML to be generated.

Remaining tasks

Modify TableDataExtension.php to introduce an optional parameter (header) that allows <th> elements to be generated in the first row.

User interface changes

None.

API changes

None.

Data model changes

None.

Feature request
Status

Active

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024