Previous Topic: Configuring the Search Results LayoutNext Topic: Optional Columns in the Results


Applying Styles to Rows, Columns and Cells

The styling to be applied to particular rows, columns or cells of the results can be controlled through the search definition and the stored procedure.

The style for every value in a column (including the heading) is defined using the style attribute of the column element, and can be any valid CSS style.

Controlling the style for individual rows is more complex as each row needs to be assigned a style based on some condition. Because of this, the style has to be defined within the stored procedure and returned in the results. A new column is therefore included in the results containing the name of a CSS class for each row. The name of this 'row_style' column is identified using the row_style_ref attribute of the results element.

Note: Default style settings for cells will take precedence over the row style. To force the row style to override the default cell styles, an additional CSS selector is required to apply the class to the td element. For example:

.myrowclass, .myrowclass td { …; }

If required, you can even control the styles of individual cells within the results. This works in a similar manner to the row styling, but an additional col_style column is required for each column of results that needs custom styling. The name of the 'col_style' column is identified using the col_style_ref attribute of the column element.

Row and cell styling will require corresponding CSS classes to be defined in the style-sheet.

Note: The precedence rules for CSS can be complex and it is sometimes necessary to force the required style to be applied by using the !important rule. For example:

.myclass {font-size: 20pt !important;}