Questionnaire appearance

Colours and layout

A number of pound instructions control the formatting of several aspects of the questionnaire appearance. Another page of this documentation identifies which aspects of the page are controlled by CSS styles.

Colours and layout

All tabular outputs (tables and MEMO questions within questionnaires but also parameter tables in utilities, record dumps in cwNav, two-way crosstabs in cwFreq, etc.) are produced by the same protocol. This protocol uses the pound instructions stored within the questionnaire to format tabular outputs. If the questionnaire script does not contain specific instructions for a particular aspect of the tabular output, CallWeb uses the specific installation defaults stored in the instance configuration directory. If instructions are not found there, defaults apply.

Advanced colours and layout

It is possible to control the formatting of question tables in a finer way by using a CSS style sheet. To access this advanced mode, first activate it with the following pound instruction:

# Styles for tables = yes

With this mode activated, the format of table cells is controlled by a collection of style sheets rather than by the pound instructions listed above. The following image documents which style controls which cell. The lines of style definition under the image indicate the statements used in the style.css file (note that all style names are in uppercase letters).

Advanced colours and layout

 .ORDINARY_CELL_A, .ORDINARY_CELL_A0, .ORDINARY_CELL_A1 { background: #E4EDF9; }
.ORDINARY_CELL_A2 { background: #F9FAFF; }
.ORDINARY_CELL_B, .ORDINARY_CELL_B0, .ORDINARY_CELL_B1 { background: #FFFFFF; }
.ORDINARY_CELL_B2 { background: #CCCCCC; }
.SPECIAL_COLUMN0 { background: #FFFFFF; }
.SPECIAL_COLUMN1 { background: #FFFF66; }
.SPECIAL_COLUMN2 { background: #CCFF00; }
.SPECIAL_LINE_A0 { background: #FFFFFF; }
.SPECIAL_LINE_B0 { background: #CCCCCC; }
.SPECIAL_CELL1 { background: #FFFFCC; }
.SPECIAL_CELL2 { background: #CCFF99; }

Here is how this works:

  • first, note that the table is broken down into three vertical sections (because there are two questions side by side; it would be two if there was only one question and four if there were three questions, etc,):
    • the first vertical section is the column of row labels; note that all styles in that column end with a "0";
    • the second vertical section corresponds to the first question; all of its styles end with "1";
    • the third vertical section is where the second question is located; all of its styles end with "2";
    • if there were more vertical questions, the numbering of the styles would ensue.
  • second, note that, in the body of the table, the colours of lines alternate for odd-numbered and even-numbered lines; styles corresponding to odd-numbered lines have an "A" as the second last character while the syles for even-numbered lines have a "B" in the same position;
  • there are 4 style name prefixes:
    • SPECIAL_COLUMN (which becomes SPECIAL_COLUMN0, SPECIAL_COLUMN1 and SPECIAL_COLUMN2 for the various vertical sections) controls the column headers;
    • SPECIAL_LINE_ (which becomes SPECIAL_LINE_A0 for the odd-numbered lines in section 0, etc.) controls the line headers;
    • SPECIAL_CELL (which becomes SPECIAL_CELL0 and SPECIAL_CELL1 for the various vertical sections) controls the cells belonging to columns defined as "special" using a answer category behaviour code or the table definition pound instruction;
    • ORDINARY_CELL_ (which becomes ORDINARY_CELL_A1, ORDINARY_CELL_B1, ORDINARY_CELL_A2 and ORDINARY_CELL_B2 for the odd- and even- numbered lines in sections 1 and 2, etc.) controls the cells in the body of the table.
  • if this advanced mode is used in a project, it also affects the presentation of tables in utility programs. Therefore, it is a good idea to define the following styles (which are not used in question tables but are in other contexts): ORDINARY_CELL_A, .ORDINARY_CELL_A0, .ORDINARY_CELL_B, .ORDINARY_CELL_B0.

Questionnaire appearance

Colours and layout

A number of pound instructions control the formatting of several aspects of the questionnaire appearance. Another page of this documentation identifies which aspects of the page are controlled by CSS styles.

Colours and layout

All tabular outputs (tables and MEMO questions within questionnaires but also parameter tables in utilities, record dumps in cwNav, two-way crosstabs in cwFreq, etc.) are produced by the same protocol. This protocol uses the pound instructions stored within the questionnaire to format tabular outputs. If the questionnaire script does not contain specific instructions for a particular aspect of the tabular output, CallWeb uses the specific installation defaults stored in the instance configuration directory. If instructions are not found there, defaults apply.

Advanced colours and layout

It is possible to control the formatting of question tables in a finer way by using a CSS style sheet. To access this advanced mode, first activate it with the following pound instruction:

# Styles for tables = yes

With this mode activated, the format of table cells is controlled by a collection of style sheets rather than by the pound instructions listed above. The following image documents which style controls which cell. The lines of style definition under the image indicate the statements used in the style.css file (note that all style names are in uppercase letters).

Advanced colours and layout

 .ORDINARY_CELL_A, .ORDINARY_CELL_A0, .ORDINARY_CELL_A1 { background: #E4EDF9; }
.ORDINARY_CELL_A2 { background: #F9FAFF; }
.ORDINARY_CELL_B, .ORDINARY_CELL_B0, .ORDINARY_CELL_B1 { background: #FFFFFF; }
.ORDINARY_CELL_B2 { background: #CCCCCC; }
.SPECIAL_COLUMN0 { background: #FFFFFF; }
.SPECIAL_COLUMN1 { background: #FFFF66; }
.SPECIAL_COLUMN2 { background: #CCFF00; }
.SPECIAL_LINE_A0 { background: #FFFFFF; }
.SPECIAL_LINE_B0 { background: #CCCCCC; }
.SPECIAL_CELL1 { background: #FFFFCC; }
.SPECIAL_CELL2 { background: #CCFF99; }

Here is how this works:

  • first, note that the table is broken down into three vertical sections (because there are two questions side by side; it would be two if there was only one question and four if there were three questions, etc,):
    • the first vertical section is the column of row labels; note that all styles in that column end with a "0";
    • the second vertical section corresponds to the first question; all of its styles end with "1";
    • the third vertical section is where the second question is located; all of its styles end with "2";
    • if there were more vertical questions, the numbering of the styles would ensue.
  • second, note that, in the body of the table, the colours of lines alternate for odd-numbered and even-numbered lines; styles corresponding to odd-numbered lines have an "A" as the second last character while the syles for even-numbered lines have a "B" in the same position;
  • there are 4 style name prefixes:
    • SPECIAL_COLUMN (which becomes SPECIAL_COLUMN0, SPECIAL_COLUMN1 and SPECIAL_COLUMN2 for the various vertical sections) controls the column headers;
    • SPECIAL_LINE_ (which becomes SPECIAL_LINE_A0 for the odd-numbered lines in section 0, etc.) controls the line headers;
    • SPECIAL_CELL (which becomes SPECIAL_CELL0 and SPECIAL_CELL1 for the various vertical sections) controls the cells belonging to columns defined as "special" using a answer category behaviour code or the table definition pound instruction;
    • ORDINARY_CELL_ (which becomes ORDINARY_CELL_A1, ORDINARY_CELL_B1, ORDINARY_CELL_A2 and ORDINARY_CELL_B2 for the odd- and even- numbered lines in sections 1 and 2, etc.) controls the cells in the body of the table.
  • if this advanced mode is used in a project, it also affects the presentation of tables in utility programs. Therefore, it is a good idea to define the following styles (which are not used in question tables but are in other contexts): ORDINARY_CELL_A, .ORDINARY_CELL_A0, .ORDINARY_CELL_B, .ORDINARY_CELL_B0.