Usage Note 23348: How can I make cell values right-justified in ODS HTML output?
To change the justifications of table cells, use the JUST=
attribute. The values for JUST= are
L, C, and R. You can specify JUST= in one of two ways:
Modifying the table template is supported for procedures that have table templates, and the DATA step. PROCs PRINT, REPORT, TABULATE and PROC FREQ's crosstab tables do NOT have table templates.
In the below example, the default DATA step template is
modified to right-justify character variables.
proc template;
edit Base.Datastep.Table;
notes 'Default DATA Step Table Definition';
edit _charvar_;
just=right ;
end;
end;
run;
ods html file="file.html";
data _null_;
file print ods=(template='base.datastep.table'
columns=(_charvar_=name(generic=on)
_charvar_=sex(generic=on)));
set sashelp.class;
put _ods_;
run;
ods html close;
Modifying the style template works for all SAS procedures.
In the below example, the JUST= attribute is specified within the style element Data to right-justify the data values.
proc template;
define style styles.justify;
Parent=styles.default;
Style Data from Data /
Just=R;
end;
run;
ods html file="file.html" style=styles.justify;
/* PROC steps here */
ods html close;
See also the full PROC TEMPLATE FAQ and Concepts.
Operating System and Release Information
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Type: | Usage Note |
| Priority: | low |
| Topic: | SAS Reference ==> ODS (Output Delivery System) Third Party ==> Output ==> HTML
|
| Date Modified: | 2006-08-30 17:02:17 |
| Date Created: | 2003-08-08 16:41:00 |