SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Enhancing HTML Tabular Reports
Applying the STYLE= Option


In the lesson Producing HTML Output, you learned to specify styles for HTML output, applying the STYLE= option to change the look of your output. Although that lesson discussed the PRINT procedure, the STYLE= option also works with PROC TABULATE:


     ods listing close;
     ods html path='c:\data'(url=none)
         body='table.html' style=brick;
     proc tabulate data=clinic.admit;
        var fee;
        class sex;
        table sex all,fee;
     run;
     ods html close;
     ods listing;
  Fee
Sum
Sex 1418.35
F
M 1268.60
All 2686.95
 
     ods listing close;
     ods html path='c:\data'(url=none)
         body='table.html' style=brown;
     proc tabulate data=clinic.admit;
        var fee;
        class sex;
        table sex all,fee;
     run;
     ods html close;
     ods listing;
  Fee
Sum
Sex 1418.35
F
M 1268.60
All 2686.95


When you specify the STYLE= option in an ODS HTML statement, the specified style controls the overall appearance of your output. But you can use the STYLE= option within PROC TABULATE to change the appearance of individual rows, columns, and cells.


General form, STYLE= option within PROC TABULATE:
STYLE=<style-name> <<parent>>
{<attribute-1=value> <...attribute-n=value>}

where

  • style-name refers to a predefined style
  • <parent> applies the style attributes of the nesting cell
  • attribute specifies a style attribute to alter, such as

    foreground font_face
    background font_size
    backgroundimage     font_style
    flyover font_weight

Note: You can shorten the keyword style to s in your programs:

s={background=yellow}


Also, you can use square brackets [ ] instead of curly braces to enclose attributes and values:

s=[background=cyan]


Because you can apply the STYLE= option to any part of your table, it provides a great amount of creative control.


back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement