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;
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.
add another style
STYLE(column)=[background=gray]
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.