Script: Simple Grid - Repeat Headers With Group Labels
This article will show you how to repeat the column headers along with the group labels in a Simple Grid
Background
If you have a Simple Grid with a number of 'Response Groups', you may want to repeat the column headers along with them. This article will show you how to do so.
Instructions
- Program your 'Simple Grid - Horizontal Radio' question
- See article: Standard Question: Grid
- Add the following to the '+ Javascript' field
- See article: Adding JavaScript and/or CSS to a Question
- No need to update anything. Just copy and paste this in.
var $ = jQuery; $headers = $(".cm-simple-grid").find("table").find("tr").eq(0).detach().clone(); $groupTr = $(".cm-simple-grid__row-group-header").closest("tr"); $($headers).insertAfter($groupTr);
- Make sure to test