Use the template_data
tag with the headerrowhtml
parameter to define custom HTML headers for tables that require multiple rows of column headings. The headerrowhtml
parameter targets the content inside the <thead>
tag in the table's HTML and replaces it with custom HTML specified by the programmer.
In this example, two additional column headers span two columns each and are displayed in bold, while the headers from the TIMEFRAMES column appear in regular font.
Details
- The
headerrowhtml
parameter can be placed in a single-line or in a multi-line format using heredoc, as shown above. - If a single line is used, single quotes are required around the HTML, e.g.,
template_data: { headerrowhtml => '<tr><td>Custom header</td></tr>' }
. - When using heredoc, separate heredoc delimiters are needed for both the
template_data
tag and theheaderrowhtml
parameter inside it ('END' and 'ENDTD'). - The HTML adds column headers for on screen display only. In the survey data and reports, the TIMEFRAMES list items are still used as the column IDs/labels.
- Ensure the displayed text in the header row HTML aligns with the corresponding columns.
Tip! Before using custom HTML, check if an existing table heading tag meets your needs.
Comments
0 comments
Please sign in to leave a comment.