BookmarkSubscribeRSS Feed
Adrienne
Fluorite | Level 6
Hi,

I'm playing around with ODS and CSS files for the first time. I'm creating a .css file with a plan to eventually modify it slightly and then use it with other programs. However, when I use what I create I don't get the same html file.

Here is the code:

/* create CSS */
ods html path='c:\temp\' (url=none)
file ='styleBrown.html'
style=brown
stylesheet="brown.css";
proc print data=sashelp.class(obs=3);
title "1) creating and using a css file";
run;
ods html close;

/* use CSS */
ods html path='c:\temp\' (url=none)
file ='styleBrown2.html'
stylesheet=(url="brown.css");
proc print data=sashelp.class(obs=3);
title "1) creating and using a css file";
run;
ods html close;

Since I don't want to post all the html code from both files. Here are the comparisons between the two lines that are different in the files.

Compare: (<)C:\temp\styleBrown.html (2648 bytes)
with: (>)C:\temp\styleBrown2.html (2607 bytes)

49c49
<
---
>


56c56
<

---
>


What can I do to get the 2nd file to look like the 1st one? (Note: I tried to bold the differences in the two lines, but then I lost the ends of the lines)

I'm using SAS 9.2 TS Level 2M0 on WinXP.

Thanks.
2 REPLIES 2
Kevin_SAS
SAS Employee
The issue that you are running into here is a problem with mixing HTML attributes and CSS properties. When you run your second HTML job you are implicitly using styles.default as the style. This style has attributes in it that will affect the HTML attributes on the table element in the output document. In order for the HTML to match up, you will have to specify style=brown on the second ODS HTML statement.

We are currently working on better support for CSS that will hopefully eliminate this CSS/HTML dichotomy; however, not all current browsers support enough features of CSS to entirely mimic everything that you can do with HTML attributes on tables.
Adrienne
Fluorite | Level 6
Thanks, Kevin. I'll try putting that in. At least I know it's not me. 🙂

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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