Usage Note 23628: Can I use my existing CSS with ODS?
You can use your existing CSS with ODS. However,
you probably cannot use it right out of the
box, because ODS carries over the PROC TEMPLATE style elements as the
CSS class names, and the class names will not
match those in your CSS.
For example, much of the ODS HTML output
is tagged with <td>. So the td
properties are applied not just to the table cells but also to
the headers, titles, and footnotes, and so on. See the table
in The STYLESHEET Defaults
to learn which
CSS properties are assigned to the
PROC TEMPLATE style elements.
In order to make your CSS classes match the output's
classes, you must
specify the correct
class name as the argument to the HTMLCLASS= option within the appropriate
STYLE statement
of PROC TEMPLATE. Issue similar code for every mismatched
class name in your CSS.
Here is an example: The class .Header1 for example could be a class specified in your existing CSS file to format table headings. But the output generated with SAS uses the class .Header for the table headers. Therefore, the class .Header1 is not used.
Instead, the style element Header from PROC TEMPLATE
is carried over into the default CSS for your ODS output.
Therefore, you must reassign the class .Header to .Header1 by
issuing HTMLCLASS= attribute as follows:
proc template;
define style styles.test;
parent=styles.default;
style header from header /
htmlclass='Header1';
end;
run;
ods html file="c:\temp\temp.html" stylesheet=(url="c:\temp\newcss.css");
proc print data=ashelp.class;
run;
ods html close;
PROC TEMPLATE
can be used in conjunction with an existing CSS.
See Order of Precedence for an explanation of
which style definitions take precedence.
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: | Query and Reporting ==> Creating Reports ==> Stylesheets SAS Reference ==> ODS (Output Delivery System)
|
Date Modified: | 2008-09-03 21:26:04 |
Date Created: | 2003-12-24 13:10:24 |