Desktop User Guides > 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:
This graphic is described in the surrounding text.
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. 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, put the following after the question text:
style (indent = <distance>)
To set the indent in the routing section, type:
<question_name>.Style.Indent = <distance>
where <distance> is a number, optionally followed by a unit of measurement: inches (in), centimeters (cm), millimeters (mm), points (pt), ems (em), or pixels (px). The default is ems. Measurements can be negative (in fact, an indent of −1 is required to line the response list up with the start of the question text).
You cannot override the default indent by using a layout template that lines up the response list with the question text (see Laying out the components of a question). 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 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:
This graphic is described in the surrounding text.
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