Professional > Interview scripting > Writing interview scripts > Page layout facilities > Styles > Categorical response lists > Indenting response lists
 
Indenting response lists
You can indent the response list by a fixed amount relative to the question text (the parent of the response list). The following example uses an indent of 3; compare it with the default indent of 1 used in the illustrations in other topics:
Exactly how far an indentation instruction indents depends on which Player you are using to run interviews. The HTML Player uses the margin-left HTML style to calculate the amount of indentation. See http://www.w3.org/TR/REC-CSS1 for details. As a general rule, an indent setting with no measurement unit (as in the example) is assumed to be in ems, where 1em is the height of the element’s font.
To set the indent in the metadata section, place the following after the question text:
style (indent = distance)
To set the indent in the routing section, type:
Qname.Style.Indent = distance
where:
distance is a number optionally followed by a unit of measurement. Valid units are inches (in), centimeters (cm), millimeters (mm), points (pt), ems (em), and pixels (px). The default is ems. Measurements may be negative (in fact, an indent of −1 is required to line the response list up with the start of the question text).
Note You cannot override the default indent simply by using a layout template that lines up the response list with the question text (see Laying out the components of a question for details). The default indentation is applied on top of the template’s settings. Always set the indentation to 0 (or even −1) in the script if you do not want response lists indented.
Indentation is particularly useful when displaying two or more questions on the same line, as you might do when replicating forms. The first question on the line is the parent of the next question, so one way of inserting space between the two questions is to specify an indent as part of the style for the second question. If the questions are defined as:
Title1 "Title"
labelstyle(width="5em")
style(elementalign="right", control(type="droplist"))
categorical [1..1]
{Ms, Miss, Mrs, Mr};
FirstName1 "First Name"
labelstyle(width="5em")
style(elementalign="right")
text [0..40];
Initials1 "Middle Initials"
labelstyle(elementalign="right", indent=2, width="6em")
style(elementalign="right", width="5em")
text [0..40];
LastName1 "Last Name"
labelstyle(elementalign="right", indent=2, width="5em")
style(elementalign="right", width="13.5em")
text [0..40];
FullName1 "" page(Title1, LastName1, FirstName1, Initials1);
and you use a template that places more than one question on a line, the output might look as follows:
Without the indentation there would be no space between the LastName and Initials question texts and the preceding input boxes.
See also
Categorical response lists