1
votes

Here's my code. I know how to format the subtitle Total. But how to make the Total column be bold and red instead of default black?

proc tabulate data=HAVE missing;
class Date City/order=data preloadfmt;
format City $Areaformat.;
var Index;
table (Date=''), Index*(sum='') * (City='' all=Total);
run;
1

1 Answers

1
votes

You need to use the keyword statement. That lets you apply a style (and other things) to keywords such as all, or even to statistics like mean.

To have the bold apply to the entire column, you can use [style=<parent>] to bring the style of all down, or you can apply it directly inline.

proc tabulate data=sashelp.class;
  class sex age;
  var height;
  keyword all/style={fontweight=bold};
  keyword mean;
  *Options - first brings the style from the all keyword, second applies directly.;
  tables (sex=''),height*(mean='') * (age='' all=Total)*[style=<parent>];
  tables (sex=''),height*(mean='') * (age='' all=Total*[style={fontweight=bold}]);

run;