BookmarkSubscribeRSS Feed
j-solver
Calcite | Level 5

I want to add a simple grey background behind a table in a pdf. I can put a grey bar as a background image for text, but can't seem to do it for a table. Is there an option to create this?

 

 

ods pdf text = "^{style [cellwidth=8.5in cellheight=0.41in backgroundimage='D:\Graphics\grey_bar.png'];

proc report data=table 
style(header) = [background=gray foreground=white just=center vjust=center fontsize=&table_font fontweight=bold fontfamily=calibri]
col col_1 col_2 col_3 col_4 obs;

define col_1 /"Column 1" ;
define col_2 /"Column 2" ;
define col_3 /"Column 3" ;
define col_4 /"Column 4" ;
define obs /computed noprint;

compute obs;
obsno + 1;
obs = obsno;

if mod(obs,2) = 0 then 
call define (_row_, 'style', 'style = [background = lightgrey]');
endcomp;
run;

 

2 REPLIES 2
ballardw
Super User

Please describe a bit more clearly, or if you can show a picture that may save a lot of words.

 

You might want something similar to

   style(report)=[background=gray]
   style(header)=[background=gray]
   style(column)=[background=gray]
   style(lines)=[background=gray]
   style(summary)=[background=gray]

as part of your proc statement to see all of the areas of a table

 

Your ODS pdf has unbalanced quotes, btw.

ghosh
Barite | Level 11

add another style

	STYLE(column)=[background=gray] 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 891 views
  • 0 likes
  • 3 in conversation