Desktop productivity for business analysts and programmers

Left align ouput

Reply
Not applicable
Posts: 0

Left align ouput

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
SAS Super FREQ
Posts: 9,425

Re: Left align ouput

Posted in reply to deleted_user
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
Not applicable
Posts: 0

Re: Left align ouput

Posted in reply to Cynthia_sas
Hi Cynthia,

It works! Thanks!!!

Thierry
Not applicable
Posts: 0

Re: Left align ouput

Posted in reply to deleted_user
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
SAS Super FREQ
Posts: 9,425

Re: Left align ouput

Posted in reply to deleted_user
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
Not applicable
Posts: 0

Re: Left align ouput

Posted in reply to Cynthia_sas
Hi Cynthia, So there's no way to outline the output to the left?

Thierry
SAS Super FREQ
Posts: 9,425

Re: Left align ouput

Posted in reply to deleted_user
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
Not applicable
Posts: 0

Re: Left align ouput

Posted in reply to Cynthia_sas
Hi Cynthia,

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

Thierry
Occasional Contributor
Posts: 8

Re: Left align ouput

Posted in reply to Cynthia_sas

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];

Occasional Contributor
Posts: 8

Re: Left align ouput

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!
Occasional Contributor
Posts: 8

Re: Left align ouput

Posted in reply to Cynthia_sas

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];

Ask a Question
Discussion stats
  • 10 replies
  • 8275 views
  • 0 likes
  • 3 in conversation