BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BenConner
Pyrite | Level 9

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;

1 ACCEPTED SOLUTION

Accepted Solutions
Alpay
Fluorite | Level 6

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

2 REPLIES 2
Alpay
Fluorite | Level 6

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;

BenConner
Pyrite | Level 9

Hi Alpay,

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

--Ben

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 2121 views
  • 1 like
  • 2 in conversation