Chapter Contents |
Previous |
Next |
The TEMPLATE Procedure |
Requirement: | An END statement must be the last statement in the definition. |
Featured in: | Creating a Stand-alone Style Definition |
DEFINE STYLE
style-path </ STORE=libname.template-store>;
|
Required Arguments |
Options |
Availability: | Version 8 of the SAS System |
Style-definition Attributes |
When you specify a parent, all the style elements and attributes and statements that are specified in the parent's definition are used in the current definition unless the current definition overrides them.
SAS Institute provides some style definitions. You can specify one of these style definitions for style-path, or you can specify a user-defined style definition. Some of the style definitions that are currently shipped with the SAS System include:
For information on finding an up-to-date list of the style definitions and for viewing a style definition, see Customizing Presentation Aspects of ODS Output.
Tip: | The NOTES statement becomes part of the compiled style definition, which you can view with the SOURCE statement, whereas SAS comments do not. |
NOTES 'text'; |
Required Arguments |
Restriction: | To use the REPLACE statement, you must specify a parent style definition with PARENT= in the DEFINE STYLE statement. |
See also: | How Do Style-Definition Inheritance and Style-Element Inheritance Work? |
Featured in: | Modifying the Default Style Definition for the HTML Destination |
REPLACE
style-element-name-1 <FROM style-element-name-2><'text'>
</ style-attribute-specification(s)>; |
Required Arguments |
Options |
style-attribute-name=style-attribute-value |
Restriction: | If style-attribute-name refers to a user-defined attribute, you must enclose the name in quotation marks. If style-attribute-name refers to an attribute that is listed in Style Attributes , do not enclose the name in quotation marks. For more information on user-defined attributes, see Style Attributes. |
Featured in: | Creating a Stand-alone Style Definition |
STYLE
new-style-element-name <FROM existing-style-element-name><'text'>
</ style-attribute-specification(s)>; |
Required Arguments |
Options |
style-attribute-name=style-attribute-value |
Restriction: | If style-attribute-name refers to a user-defined attribute, you must enclose the name in quotation marks. If style-attribute-name refers to an attribute that is listed in Style Attributes, do not enclose the name in quotation marks. |
For more information on style-attribute values, see Style Attributes.
Style Attributes |
The default value that is used for an attribute depends on the style definition that is in use. For information on viewing the attributes in a style definition, see Customizing Presentation Aspects of ODS Output. The implementation of an attribute depends on the ODS destination that formats the output. In addition, if you are creating HTML output, the implementation of an attribute depends on the browser that you use.
Values for style attributes are often one of the following:
cm | centimeters |
in | inches |
mm | millimeters |
pt | a printer's point |
px | pixels (based on the size of a pixel on the target device) |
Note: In Version 8 of the SAS
System, only the Printer
destination supports units of measure on dimensions. However, if you specify
CSS in the ODS HTML statement, the HTML destination supports units of measure.
The CSS option is experimental in Version 8.
Default: | For the HTML destination, pixels; for the Printer destination, units of 1/150 of an inch |
Note: Use
these colors only if you are running SAS in the windowing
environment.
Lightness | Saturation | Hue |
---|---|---|
black | gray | blue |
very dark | grayish | purple |
dark | moderate | red |
medium | strong | orange | brown |
light | vivid | yellow |
very light | green | |
white |
You can combine these words to form a wide variety of colors. Some examples are
Note: The Output Delivery system first tries to match
a color with a SAS/GRAPH color. Thus, although brown and orange are interchangeable
in the table, if you use them as unmodified hues, they are different. The
reason for this is that ODS interprets them as SAS colors, which are mapped
to different colors.
You can also specify hues that are intermediate between two neighboring colors. To do so, combine one of the following adjectives with one of its neighboring colors:
For example, you can use the following as hues:
See also: | For information on SAS/GRAPH colors, see SAS/GRAPH Software: Reference. |
style datacell / background=blue foreground=white;
Later, you can ensure that another style element, NEWCELL, uses the same background color by defining it this way:
style newcell / background=datacell(background);
Similarly, suppose that you create a style element called HIGHLIGHTING that defines three attributes this way:
style highlighting / "go"=green "caution"=yellow "stop"=red;Later, you can define a style element called MESSAGES that uses the colors that are defined in HIGHLIGHTING:
style messages; "note"=highlighting("go") "warning"=highlighting("caution") "error"=highlighting("stop");In this way, multiple style elements could use the colors that you define in HIGHLIGHTING. If you decide to change the value of
go
to blue, you simply change
its value in the definition of HIGHLIGHTING, and every style element that
references highlighting ("go") will use blue instead of green.
Note: In the first example, the style attribute BACKGROUND= is a predefined
style attribute. Therefore, when you reference it, you do not put it in quotation
marks. However, in the second example, go
is
a user-defined attribute. You define it with quotation marks, and when you
reference it, you must use quotation marks. (This section describes all the
predefined style attributes that are available.)
You can use a special form of reference to get a value for a style attribute
from the macro table at the time that the style element is used. For instance,
the following STYLE statement uses the current value of the macro variable bkgr
for the background color of the style element cell
:
style cell / background=symget("bkgr");
Featured in: | Creating and Modifying a Style Definition with User-Defined Attributes |
("font-face-1 <... , font-face-n>", font-size, keyword-list) |
font-size specifies the size of the font. font-size can be a dimension or a number without units of measure. If you specify a dimension, you must specify a unit of measure. Without a unit of measure the number becomes a size that is relative to all other font sizes in the document. See the discussion of dimensions.
keyword-list specifies the font weight, font style, and font width. You can include one value for each, in any order. The following table shows the keywords that you can use:
Keywords for Font Weight | Keywords for Font Style | Keywords for Font Width |
---|---|---|
MEDIUM | ITALIC | NORMAL* |
BOLD | ROMAN | COMPRESSED* |
DEMI_BOLD* | SLANT | EXTRA_COMPRESSED* |
EXTRA_BOLD* | NARROW* | |
LIGHT | WIDE* | |
DEMI_LIGHT* | EXPANDED* | |
EXTRA_LIGHT* | ||
*Few fonts honor these values. |
Featured in: | Creating and Modifying a Style Definition with User-Defined Attributes |
To do this ...* | Use this attribute | |
---|---|---|
Influence the characteristics of individual cells | ||
Specify how to handle leading spaces, trailing spaces, and line breaks. | ASIS= | |
Specify the height of the cell. | CELLHEIGHT= | |
Specify the width of the cell. | CELLWIDTH= | |
Specify the text to show in a tool tip for the cell. | FLYOVER= | |
Specify the window or frame in which to open the target of the link. | HREFTARGET= | |
Specify how to handle space characters. | NOBREAKSPACE= | |
Specify text to insert in the HTML | TAGATTR= | |
Specify a URL to link to. | URL= | |
Specify vertical justification. | VJUST= | |
Influence the characteristics of individual tables or cells | ||
Specify a font definition. | FONT= | |
Specify the font face to use. | FONT_FACE= | |
Specify the size of the font. | FONT_SIZE= | |
Specify the style of the font. | FONT_STYLE= | |
Specify the font weight. | FONT_WEIGHT= | |
Specify the font width compared to the width of the usual design. | FONT_WIDTH= | |
Specify the color of the foreground, which is primarily the color of the text. | FOREGROUND= | |
Specify the name of the stylesheet class to use for the table or cell. | HTMLCLASS= | |
Specify an ID for the table or cell. | HTMLID= | |
Specify individual attributes and values for the table or cell. | HTML_STYLE= | |
Specify justification. | JUST= | |
Specify the HTML code to place after the HTML table or cell. | POSTHTML= | |
Specify an image to place after the HTML table or cell. | POSTIMAGE= | |
Specify text to place after the cell or HTML table. | POSTTEXT= | |
Specify the HTML code to place before the HTML table or cell. | PREHTML= | |
Specify an image to place before the HTML table or cell. | PREIMAGE= | |
Specify text to place before the cell or HTML table. | PRETEXT= | |
Determine how less-than signs (<), greater-than signs (>), and ampersands (&) are interpreted. | PROTECTSPECIALCHARACTERS= | |
Influence the characteristics of tables | ||
Specify the amount of white space on each of the four sides of the text in a cell. | CELLPADDING= | |
Specify the thickness of the spacing between cells. | CELLSPACING= | |
Specify the type of frame to use on an HTML table. | FRAME= | |
Specify the width of the HTML table. | OUTPUTWIDTH= | |
Specify the types of rules to use in an HTML table. | RULES= | |
Influence the characteristics of individual frames in HTML output | ||
Specify the string to use for bullets in the contents file. | BULLETS= | |
Specify the position, within the frame file, of the frames that display the contents and the page files. | CONTENTPOSITION= | |
Specify whether or not to put a scrollbar in the frames in the frame file that display the contents and the page files. | CONTENTSCROLLBAR= | |
Specify the width of the frames in the frame file that display the contents and the page files. | CONTENTSIZE= | |
Specify whether or not to put a border around the frame for an HTML file that uses frames. | FRAMEBORDER= | |
Specify the width of the border around the frames for an HTML file that uses frames. | FRAMEBORDERWIDTH= | |
Specify the width of the space between frames for HTML that uses frames. | FRAMESPACING= | |
Influence the characteristics of the document | ||
Specify the bottom margin for the document. | BOTTOMMARGIN= | |
Provide the value of the content type for pages that you send directly to a web server rather than to a file. | HTMLCONTENTTYPE= | |
Specify the entire doctype declaration for the HTML document, including the opening "<!DOCTYPE" and the closing ">". | HTMLDOCTYPE= | |
Specify the left margin for the document. | LEFTMARGIN= | |
Specify the color for links that have not yet been visited. | LINKCOLOR= | |
Specify whether or not to make this entry in the table of contents a link to the body file. | LISTENTRYANCHOR= | |
Specify whether or not to double space between entries in the table of contents. | LISTENTRYDBLSPACE= | |
Specify the height for graphics in the document. | OUTPUTHEIGHT= | |
Specify an upper limit for extending the width of the column. | OVERHANGFACTOR= | |
Specify HTML to place at page breaks. | PAGEBREAKHTML= | |
Specify the right margin for the document. | RIGHTMARGIN= | |
Specify the top margin for the document. | TOPMARGIN= | |
Specify whether or not to make the image that is specified by BACKGROUNDIMAGE= into a "watermark." A watermark appears in a fixed position as the window is scrolled. | WATERMARK= | |
*Different attributes affect different ODS destinations. For details, consult the documentation for a specific attribute. |
Note: You can use the value _UNDEF_ for any style attribute.
ODS treats an attribute that is set to _UNDEF_ as if its value had never been
set, even in the parent or beyond.
In the list of style attributes that follows, any attribute that is not documented as applying to a particular destination applies to all destinations that support the STYLE= option in the ODS statement that opens the destination. In Version 8 of the SAS System, the two destinations that support STYLE= are the HTML destination and the Printer destination.
Applies to: | cells |
Tip: | Generally, the background color of the cell overrides the background color of the table. You see the background color for the table only as the space between cells (see CELLSPACING=). |
Applies to: | tables or cells |
Featured in: | Creating a Stand-alone Style Definition and Modifying the Default Style Definition for the HTML Destination |
Applies to: | tables or cells |
ODS Destinations: | HTML |
Tip: | Typically, BODYSCROLLBAR is set to AUTO. |
Applies to: | frame |
ODS Destinations: | HTML |
Applies to: | frame |
ODS Destinations: | HTML |
Applies to: | tables or cells |
Applies to: | tables or cells |
ODS Destinations: | HTML |
Featured in: | Creating a Stand-alone Style Definition and Modifying the Default Style Definition for the HTML Destination |
Applies to: | tables or cells |
ODS Destinations: | HTML |
Featured in: | Creating a Stand-alone Style Definition and Modifying the Default Style Definition for the HTML Destination |
Applies to: | tables |
Tip: | Typically, when BORDERWIDTH=0, the ODS destination sets RULES=NONE (see the discussion of RULES=) and FRAME=VOID (see the discussion of FRAME=). |
Featured in: | Creating a Stand-alone Style Definition and Modifying the Default Style Definition for the HTML Destination |
Applies to: | document |
Applies to: | contents |
ODS Destinations: | HTML |
Tip: | HTML automatically sets cell height appropriately. You should seldom need to specify this attribute. |
Applies to: | cells |
ODS Destinations: | HTML and Printer |
Applies to: | tables |
Featured in: | Modifying the Default Style Definition for the HTML Destination |
Applies to: | tables |
Interaction: | If BORDERWIDTH= is nonzero, and if the background color of the cells contrasts with the background color of the table, the color of the cell spacing is determined by the table's background. |
Featured in: | Creating a Stand-alone Style Definition and Modifying the Default Style Definition for the HTML Destination |
Applies to: | cells |
Tip: | The ODS destination sets cell width appropriately. You should seldom need to specify this attribute. |
ODS Destinations: | HTML and Printer |
Alias: | L |
Alias: | R |
Alias: | T |
Alias: | B |
Applies to: | frame |
ODS Destinations: | HTML |
Tip: | Typically, CONTENTSCROLLBAR is set to AUTO. |
Applies to: | frame |
ODS Destinations: | HTML |
See also: | BODYSIZE= |
Applies to: | frame |
ODS Destinations: | HTML |
Applies to: | cells |
ODS Destinations: | HTML |
Applies to: | tables and cells |
Tip: | When you specify this attribute for a table, it affects only the text that is specified with the PRETEXT=, POSTTEXT=, PREHTML=, and POSTHTML= attributes. To alter the font for the text that appears in the table, you must set the attribute for a cell. |
Featured in: | Modifying the Default Style Definition for the HTML Destination |
You cannot be sure what fonts are available to someone who is viewing your output in a browser or printing it on a high-resolution printer. Most devices support
Applies to: | cells |
Tip: | When you specify this attribute for a table, it affects only the text that is specified with the PRETEXT=, POSTTEXT=, PREHTML=, and POSTHTML= attributes. To alter the font for the text that appears in the table, you must set the attribute for a cell. |
Featured in: | Creating a Stand-alone Style Definition |
Applies to: | table and cells |
Range: | 1 to 7, for size |
Restriction: | If you specify a dimension, you must specify a unit of measure. Without a unit of measure, the number becomes a relative size. See the discussion of dimensions. |
Tip: | When you specify this attribute for a table, it affects only the text that is specified with the PRETEXT=, POSTTEXT=, PREHTML=, and POSTHTML= attributes. To alter the font for the text that appears in the table, you must set the attribute for a cell. |
Featured in: | Creating a Stand-alone Style Definition |
Applies to: | tables and cells |
Tip: | When you specify this attribute for a table, it affects only the text that is specified with the PRETEXT=, POSTTEXT=, PREHTML=, and POSTHTML= attributes. To alter the font for the text that appears in the table, you must set the attribute for a cell. |
Featured in: | Creating a Stand-alone Style Definition and Modifying the Default Style Definition for the HTML Destination |
Applies to: | tables and cells |
Restriction: | You cannot be sure what font weights are available to someone who is viewing your output in a browser or printing it on a high-resolution printer. Most devices support only MEDIUM and BOLD, and possibly LIGHT. |
Tip: | When you specify this attribute for a table, it affects only the text that is specified with the PRETEXT=, POSTTEXT=, PREHTML=, and POSTHTML= attributes. To alter the font for the text that appears in the table, you must set the attribute for a cell. |
Featured in: | Creating a Stand-alone Style Definition |
Applies to: | tables and cells |
Restriction: | Few fonts honor these values. |
Tip: | When you specify this attribute for a table, it affects only the text that is specified with the PRETEXT=, POSTTEXT=, PREHTML=, and POSTHTML= attributes. To alter the font for the text that appears in the table, you must set the attribute for a cell. |
Featured in: | Creating a Stand-alone Style Definition |
Applies to: | tables or cells |
Tip: | When you specify this attribute for a table, it affects only the text that is specified with the PRETEXT=, POSTTEXT=, PREHTML=, and POSTHTML= attributes. To alter the font for the text that appears in the table, you must set the attribute for a cell. |
Featured in: | Creating a Stand-alone Style Definition and Modifying the Default Style Definition for the HTML Destination |
This value of frame-type ... | Creates this kind of frame around the table |
---|---|
ABOVE | a border at the top |
BELOW | a border at the bottom |
BOX | borders at the top, bottom, and both sides |
HSIDES | borders at the top and bottom |
LHS | a border at the left side |
RHS | a border at the right side |
VOID | no borders |
VSIDES | borders at the left and right sides |
Applies to: | tables |
Featured in: | Modifying the Default Style Definition for the HTML Destination |
Applies to: | frame |
ODS Destinations: | HTML |
Applies to: | frame |
ODS Destinations: | HTML |
Applies to: | frame |
ODS Destinations: | HTML |
Restriction: | Only available in Internet Explorer 5.0 or later. |
Default: | _SELF |
Applies to: | cells |
ODS Destinations: | HTML |
Applies to: | tables and cells |
Availability: | Version 8 of the SAS System |
ODS Destinations: | HTML |
Tip: | The value of string is usually "text/html". |
Applies to: | document |
ODS Destinations: | HTML |
Tip: | Most users will never need to use this attribute. |
Applies to: | document |
ODS Destinations: | HTML |
Applies to: | tables and cells |
ODS Destinations: | HTML |
Applies to: | tables and cells |
ODS Destinations: | HTML |
Alias: | C |
Applies to: | tables and cells |
Alias: | L |
Applies to: | tables and cells |
Alias: | R |
Applies to: | tables and cells |
Restriction: | Not all contexts support RIGHT. If RIGHT is not supported, it is interpreted as CENTER. |
Applies to: | document |
Applies to: | document |
ODS Destinations: | HTML |
Applies to: | document |
ODS Destinations: | HTML |
Availability: | Version 8 of the SAS System |
Applies to: | cells |
Applies to: | document |
ODS Destinations: | HTML |
Applies to: | tables |
Tip: | Use OUTPUTWIDTH=100% to make the table as wide as the window that it is open in. |
ODS Destinations: | HTML |
Tip: | Typically, an overhang factor between 1 and 2 works well. |
Applies to: | document |
ODS Destinations: | HTML |
Applies to: | document |
ODS Destinations: | HTML |
Applies to: | tables or cells |
ODS Destinations: | HTML |
Featured in: | Modifying the Default Style Definition for the HTML Destination |
Applies to: | tables or cells |
ODS Destinations: | HTML |
Applies to: | tables or cells |
Applies to: | tables or cells |
ODS Destinations: | HTML |
Applies to: | tables or cells |
ODS Destinations: | HTML |
Applies to: | tables or cells |
Applies to: | cells |
ODS Destinations: | HTML |
Applies to: | document |
This value of rule ... | Creates rules in these locations |
ALL | between all rows and columns |
COLS | between all columns |
GROUP | between the table header and the table and between the table and the table footer, if there is one |
NONE | no rules anywhere |
ROWS | between all rows |
Applies to: | tables |
Featured in: | Modifying the Default Style Definition for the HTML Destination |
Applies to: | cells |
ODS Destinations: | HTML |
Applies to: | document |
Applies to: | cells |
ODS Destinations: | HTML |
Applies to: | document |
ODS Destinations: | HTML |
Alias: | T |
Alias: | B |
Alias: | M |
Applies to: | cells |
Applies to: | document |
ODS Destinations: | HTML |
END; |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.