1.6

Table Of Contents
for(var i = 0; i < record.tables.detail.length; i++){
if(record.tables.detail[i].fields['Shipped'] == 1)
query("tr:nth-child(" + (i+1) + ")", results).css
('color','green');
}
This script loops over a detail table, evaluating the field Shipped. If the value of that field is 1, it
looks up the corresponding row in the results (the object that contains the selected detail
table) and colors the text of that row green. (See also: "query()" on page785 and "css()" on
page758.)
To keep all CSS style rules together you could add the style rules to a class in the CSS file
(see "Styling templates with CSS files" on page467) and assign that class to the a row or cell
using addClass (see "addClass()" on page745).
For another example, see this how-to: Change detail line formatting based upon a data field
value.
Background color and/or image
In any type of template, boxes, tables and table cells can have a background color and/or a
background image.
To select a background image or color:
1.
Right-click the box and click Box on the shortcut menu.
2. Alternatively, select the box (see "Selecting an element" on page389; note that a Box is a
<div> element) and on the Format menu click Box.
3.
Click the Background tab.
To select a background color: click the downward pointing arrow next to Color to select a
color from the list of predefined colors (see "Defining colors, spot colors and tints" on
Page 486