Create the master parent Base.Template.Table and specify which style element and style attributes to use for different cells in a row. The DEFINE TABLE statement creates the master parent Base.Template.Table. Base.Template.Table will be applied to every table created by SAS, unless it is overridden by another template created by PROC TEMPLATE, removed with the DELETE statement, or manually removed from the item store.


The CELLSTYLE-AS statement specifies the style element and style attributes to use for cells in each of the rows in a table, which creates the alternating row colors in the output. If the row is even numbered and does not contain a style element named RowHeader, then the cell has a green background color and white font color. Similarly, if the row is even numbered and does contain a style element named RowHeader, then the cell has a blue background color and white font color.


proc template;
define table base.template.table;
   cellstyle mod(_row_, 2) and _style_ ^= "RowHeader" as {background=blue color=white},
             mod(_row_, 2) and _style_ = "RowHeader" as {background=green color=white};
end;