BookmarkSubscribeRSS Feed
martyvd
Fluorite | Level 6

I am having trouble with a background color not populating in the second table of my HTML output. Please see the code below. 

 

ods tagsets.tableeditor file="&path\&&xst1.SASHELP..html"	
      options( 
               frozen_headers="yes"
               frozen_rowheaders="yes"
               banner_color_even="beige"
               banner_color_odd="white"
               header_bgcolor="teal"
			   header_fgcolor="white"
			   rowheader_bgcolor="lightblue"
               gridline_color="gray"
			   header_size="12"  
               rowheader_size="12" 
			   data_size="11" 
              );

PROC TABULATE NOSEPS MISSING FORMAT=comma7. FORMCHAR='              ' data=sashelp.cars;

CLASS make;
class type drivetrain / style={background=lightyellow};

/*Make Table*/

tables all*(n f=5.1*pctn<make all>) 
(type all)*(pctn<type all>)*f=5.1 
(drivetrain all)*(pctn<drivetrain all>)*f=5.1, 
all make / nocellmerge rts=16 misstext='--' box=_page_ printmiss;

keylabel all='Total' n='No.' pctn='%'; 

run; 

/*Origin Table*/

PROC TABULATE NOSEPS MISSING FORMAT=comma7. FORMCHAR='              ' data=sashelp.cars;

CLASS origin;
class type drivetrain / style={background=lightyellow};

tables all*(n f=5.1*pctn<origin all>) 
(type all)*(pctn<type all>)*f=5.1  
(drivetrain all)*(pctn<drivetrain all>)*f=5.1, 
all origin /nocellmerge rts=16 misstext='--' box=_page_ printmiss;

keylabel all='Total' n='No.' pctn='%';

run;

ods tagsets.tableeditor close;

This produces the following tables. You can see in the 2nd table that the row headers "Type" and "DriveTrain" are blue rather than light yellow as the style option specifies.

 

Capture1.PNGCapture2.PNG

 

However, the light yellow background color does show up when viewing the SAS output table.

 

Capture3.PNG

4 REPLIES 4
ballardw
Super User

If you want the levels of the class variable such as Hybrid SUV and such to have the style element then try adding:

classlev type drivetrain / style={background=lightyellow};

Classlev controls the appearance of value levels, Class controls appearance behavior of the variable heading.

 

martyvd
Fluorite | Level 6
Yes I am aware of that but my problem is with the appearance of the variable headings in the second table.
ballardw
Super User

I don't have tagsets.tableeditor installed so I can't duplicate the issue.

 

I would be tempted to remove the tagset option

rowheader_bgcolor="lightblue"

 

and see if that helps. Possibly that might require adding additional style elements to get other things to be the color you want.

martyvd
Fluorite | Level 6
I tried that but it seems that regardless of the tagset options the second table will not show any of the style options specified in the class or classlev statements.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 4 replies
  • 704 views
  • 0 likes
  • 2 in conversation