Simple tables use a question-style syntax where the type
tag specifies both the question type (e.g., radio or checkbox) and that it will be presented as a table.
1. How often do you listen to the following types of music?
type: radio table
1. Never
2. Rarely
3. Sometimes
4. Frequently
5. Everyday
rows:
1. Hip hop/rap
2. R&B/funk/soul
3. Rock
4. Classical
5. Country
To create a simple table, you need to:
- define the question ID (label),
- provide the question text,
- apply the
type
tag with the desired input, - add rows or columns, and
- provide a list of answer options (for closed-ended tables only).
Details
- Simple tables use similar input types as closed-ended and open-ended questions. Begin with the question type and add 'table' to it, e.g.,
type: checkbox table
. - Simple tables also support more "interactive" input types such as stars, radio stars, sliders, and radio sliders.
- In a
type: text table
, individual rows can have different input types (e.g.,email
,number
) and accept decorators to customize the data, such as in contact forms. The following decorators can be used on individual rows in a text table:autocomplete
,datatype
,encrypt
,if blank
,if not set
,maxlength
,minlength
,number format
,range
,required
, andsize
. - Answer options, rows, and columns can be created with inline lists (within the table's code like Q1 above) or pulled in from set lists (standalone lists), derived lists (from another question), or sheets.
- When using a
set list
, a list call tag such asoptsfrom
,rowsfrom
, orcolsfrom
is required to reference the list. - The
rows
,columns
,rowsfrom
, andcolsfrom
tags support heredoc formatting if desired.
Note: Simple tables work for most table designs. However, you can use the advanced table creation method for more complex table structures.
Commonly used tags
In addition to the type
tag, the following tags are frequently used in simple tables.
Tag | Description |
|
Specifies the columns in a table where the columns represent the questions, or in tables that require all three: rows, answer options, and columns. |
decline to answer |
Creates an opt-out ("decline to answer") option for the entire table. |
dta col and dta row |
Creates an opt-out column or opt-out row, respectively. |
|
Specifies instructions to guide the respondent. |
|
Specifies the answer options in a closed-ended table. If listing options inline, the |
|
Specifies the rows in a table where the rows are the questions. |
Creates a running total of all answers in a given column. | |
vscale: y |
Allows respondents to select options for each column instead of each row. vscale: y is only for use with radio and checkbox tables. |
Tip! For a list of table formatting and header tags, see Table formatting and display options and Table headers.
Additional examples
Using rowsfrom and colsfrom
This table has columns requiring two answers per row — one for Shapes and one for Colors. It uses rowsfrom
and colsfrom
to reference the independent lists created with set list
, while answer options are listed inline.
Decline to answer
Decline to answer options (DTAs) allow respondents to opt-out of answering the entire table.
Decline to answer column
In text or numeric tables, DTA options can be offered per row or per column. In the example below, the respondent has the opportunity to opt-out of providing an answer for a service if it is not applicable.
Summing column totals with a "total row"
Use the show column total
tag to add a "total" row at the bottom of the table, displaying the constant sum of each column.
Notice that other tags that further define a text field, such as datatype
, prefix
, maxlength
, etc., can also be applied here.
Creating a contact form
Easily create compact text tables to collect text and numerical input, even when each row / field has different requirements. In Q7, rows 3-6 have specific datatypes assigned, and each will validate the respondent's answers to ensure it fits the specified type. Additionally, Employee ID and Weekly salary are encrypted, email is encrypted by default, and Years employed is optional.
Revealing rows
When asking an unaided brand awareness question, you can create a compact table that dynamically adds rows using the reveal rows
tag. In the example below, the table begins with one row and reveals additional rows as needed when text is entered.
The table is set to required: n
, but it also validates that the first row is not blank, ensuring respondents enter text in at least one row.
Vertical scale table
In this vscale example, the columns are the questions and the rows are the answer options. You must select at least one option per column.
Comments
0 comments
Please sign in to leave a comment.