Desktop User Guides > Professional > Interview scripting > Writing interview scripts > Page layout facilities > Styles > Categorical response lists > Rows or columns, and how many?
 
Rows or columns, and how many?
The default is to display categorical responses one below the other in a single column down the page. With long response lists you can save space, and save respondents having to scroll to reach the navigation buttons, by displaying the response list in more than one column. Even with short response lists you can save space by displaying the responses across the page rather than down. You might even find that the way you display the responses affects which responses are most likely to be chosen.
In the metadata section
To specify the orientation of the response list, put the following after the question text:
style(orientation = {Column|Row|Default})
Default is the default category orientation by the Player.
When you choose row orientation and do not define the number of rows required, the interviewing program displays all responses on a single line, and tries to space the responses evenly within the line width. If you reduce the size of the display window, the responses’ positions change so that they still fit in the window’s width. When it is no longer possible to reduce the spacing between responses, a horizontal scroll bar appears.
To specify the number of rows or columns, put one of the following after the question text:
style(columns = <number>)style(rows = <number>)
where <number> is the number of rows or columns required.
Example 1: Displaying the responses column-wise in two columns
Sports11 "Which of the following sports do you play?"
  style(orientation = column, columns = 2) categorical [1..]
{Tennis, Football, Cricket, Basketball, Hockey};
This graphic is described in the surrounding text.
Example 2: Displaying the responses row-wise in two rows
Sports12 "Which of the following sports do you play?"
  style(orientation = row, rows = 2) categorical [1..]
{Tennis, Football, Cricket, Basketball, Hockey};
This graphic is described in the surrounding text.
In the routing section
To set the response list orientation in the routing section, type:
<question_name>.Style.Orientation = Orientations.{orColumn|orRow|orDefault}
orDefault is the default orientation used by the Player.
To set the number of rows or columns, use
<question_name>.Style.Rows = <number_question_name>.Style.Columns = <number>
If the question is defined as:
Sports "Which of the following sports do you play?" categorical [1..]
{Tennis, Football, Cricket, Basketball, Hockey};
the statements:
Sports.Style.Orientation = Orientations.orRow Sports.Style.Rows = 3
display the response list across the page in three rows:
This graphic is described in the surrounding text.
If you do not get what you asked for
If the interview scripting program seems to ignore your instructions for the number of rows or columns required might be because your specification does not work well with the number of responses in the response list. When the interviewing program lays out a response list in columns, it counts the number of responses to be displayed and then works out how many rows it needs to display those responses in the requested number of columns. It then fills those rows on a column-by-column basis. Depending on how many responses there are in the list, this might mean that you get fewer columns than you requested.
For example, if the response list contains 26 responses and you ask for it to be displayed columnwise in 25 columns, the interview scripting program calculates that it needs two rows to do this. It then starts allocating responses to columns, filling one column before starting the next one. This means that responses 1 and 2 go into columns 1, responses 3 and 4 go into column 2, and so on until responses 25 and 26 go into column 13.
You cannot mix row and column orientation with row and column counts. For example, you cannot set the orientation to columns and then specify the number of rows required. The interviewing program will display the response list in one column; it will not display the responses column-wise in the given number of rows. Therefore, you have two options for resolving the problem:
You can calculate the number of rows that are required, and then specify row orientation and the number of rows required to generate the number of columns you want. In the example, you must specify two rows laid out in row orientation. This lays out responses sequentially across the page, with responses 1 to 13 in row 1 and 14 to 26 in row 2.
If you must have responses listed down the page, you can reduce the number of columns.
See also
Categorical response lists