BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I've got some code that generates several tables in HTML in EG.
When I look at the output, all the tables are centered. I want them aligned to the left.

Can anyone help me?

Thierry
10 REPLIES 10
Cynthia_sas
SAS Super FREQ
Hi:
Try putting
[pre]
options nocenter;
[/pre]

before your ODS HTML step. That will left align everything, including the table and titles, and any text you might place with ODS TEXT=etc.

If what you mean is that you want the title to remain centered and ONLY the table to be left justified, then try this:
[pre]
options center;
ods html file='c:\temp\usestyle.html' style=sasweb;
proc print data=sashelp.class
style(table)={just=l};
title 'This Should Still Be Centered';
run;
ods html close;
[/pre]

If you are using PROC REPORT or PROC TABULATE, you'd use slightly different syntax with those procedures, as defined in the documentation.

cynthia
deleted_user
Not applicable
Hi Cynthia,

It works! Thanks!!!

Thierry
deleted_user
Not applicable
Well, it works almost....

Running the Stored Process in EG, it works fine. But if I run the Stored Process in Web Report Studio, it doesn't work... WRS aligns the table in the center.
I've also tried the following code:

proc tabulate data=sashelp.class ;
class sex ;
var weight ;

table sex all
,
weight*[style=[font_weight=bold]]
/style=[just=left]
;
run ;

Again, in EG it works perfect, but in WRS the last style code doesn't work...

Thierry
Cynthia_sas
SAS Super FREQ
Hi..sorry 'bout that. If I had realized you were talking about a stored process, I would have warned you about that. When you run a stored process and return the results to Web Report Studio (WRS), the results are NOT HTML, RTF or PDF, which would be affected by the NOCENTER option.

Results that are returned to WRS are returned in SASReport XML format and then, inside WRS, those results are rendered for viewing within the WRS "screen". SAS Options and styles are generally NOT used by WRS because they are not meaningful options for SASReport XML.

cynthia
deleted_user
Not applicable
Hi Cynthia, So there's no way to outline the output to the left?

Thierry
Cynthia_sas
SAS Super FREQ
Hi, TH:
If there's a way to turn off centering using Web Report Studio report options, then your output would be left-aligned. but I believe the default is centered for the default treatment of SAS Report XML -- at least what comes from a stored process.

You might check with SAS Technical Report to fine out definitively whether there's a way to change the alignment to left alignment in the Cascading Style Sheet used to render the output (or look in the Platform Administration Guide).

cynthia
deleted_user
Not applicable
Hi Cynthia,

Ok, I will do that. Thanks alot for your help.

Thierry
Ethen
Calcite | Level 5

Hi Cynthia!

 

Thanks for the code.  I tried it and it worked.  However, I am wondering if you could help point me in the right direction with regards to justifying the title left as well?

 

Thank you!

 

[pre];
options center;
ods html file='/folders/myfolders/sasuser.v94/sales2018.html' style=sasweb;
proc print data=sales3
style(table)={just=l};
title 'This Should Still Be Centered';
run;
ods html close;
[/pre];

Ethen
Calcite | Level 5
Hi Cynthia!

I was able to justify the title and it worked. Please disregard my question regarding justifying the title.

Thanks, ,again, Cynthia! I appreciate your help!
Ethen
Calcite | Level 5

Hi Cynthia!

 

Thanks for the code.  I tried it and it worked very nicely.  However, I am wondering if you could help point me in the right direction with regards to just moving the table 1inch or 2 inch, etc. from the left margin?

 

Thank you!

 

[pre];
options center;
ods html file='/folders/myfolders/sasuser.v94/sales2018.html' style=sasweb;
proc print data=sales3
style(table)={just=l};
title 'This Should Still Be Centered';
run;
ods html close;
[/pre];

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 10 replies
  • 19591 views
  • 0 likes
  • 3 in conversation