The SAS Output Delivery System and reporting techniques

Row/column headings colors in tabulate

Accepted Solution Solved
Reply
Regular Contributor
Posts: 169
Accepted Solution

Row/column headings colors in tabulate

Hi,

I have a proc tabulate whose target is a web page.  The default colors for the row and column headings/categories are blue.  Is there a way to override the text color to default to black?

Thanks much!

--Ben

ods html file='....html';

proc tabulate data=matched out=temp;

class prev curr mig;

table prev=' '*(n=' '*f=comma9. rowpctn='%'*f=pcts.),(curr="&cmon &cyear" all='Total') mig / box="&pmon &pyear";

run;

ods html close;


Accepted Solutions
Solution
‎07-03-2012 04:53 PM
Frequent Contributor
Posts: 95

Re: Row/column headings colors in tabulate

You can set the background/foreground colors using style elements.

To change text color for column/row headers use "style" option after "class" statement.

To change text color for column/row categories use "style" option after "classlev" statement.

Ex:

proc tabulate data=sashelp.class;

  class sex / style=[background=white foreground=red];

  classlev sex / style=[background=yellow foreground=blue];

  class age / style=[background=red foreground=white];;

  classlev age / style=[background=blue foreground=yellow];

  table sex='Gender',

  age='age'*n=''*[style=[background=green foreground=white]]

  / box=[label='Box Label' style=[background=white foreground=green]];

run;

View solution in original post


All Replies
Solution
‎07-03-2012 04:53 PM
Frequent Contributor
Posts: 95

Re: Row/column headings colors in tabulate

You can set the background/foreground colors using style elements.

To change text color for column/row headers use "style" option after "class" statement.

To change text color for column/row categories use "style" option after "classlev" statement.

Ex:

proc tabulate data=sashelp.class;

  class sex / style=[background=white foreground=red];

  classlev sex / style=[background=yellow foreground=blue];

  class age / style=[background=red foreground=white];;

  classlev age / style=[background=blue foreground=yellow];

  table sex='Gender',

  age='age'*n=''*[style=[background=green foreground=white]]

  / box=[label='Box Label' style=[background=white foreground=green]];

run;

Regular Contributor
Posts: 169

Re: Row/column headings colors in tabulate

Hi Alpay,

Outstanding!  Thank you very much!  Had no idea the style attribute could be used in so many places.

--Ben

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 237 views
  • 0 likes
  • 2 in conversation