Date: Tue, 20 Jan 2004 20:57:55 -0500
Reply-To: Don Stanley <don_stanley@PARADISE.NET.NZ>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Don Stanley <don_stanley@PARADISE.NET.NZ>
Subject: Tip: PROC REPORT Aligning Line statements with ODS HTML
I was asked offlist about how to embed tab characters in a PROC REPORT line
statement for HTML output. The coder wanted to see his line statements with
different sections aligned.
HTML has no concept of a TAB. It is possible to emulate TABS using the
<pre> tag and 	 character embedded in the preformatted text, but the
result is rarely what is really wanted. So you cannot really use TABS in
HTML. CSS may also permit this, but may not work on all browsers.
A simple way to emulate tabs is by creating a table. You can create a table
in a LINE statement quite simply as follows.
ods html file='c:\test.html' ;
data x ;
x = 27 ; y=30 ; z= 87 ; a= 'Afdfdfd' ;
run ;
proc report data=x nowd missing
style(column)={cellwidth=.75in}
;
column x y z a ;
compute before _page_ / style={protectspecialchars=off just=l
pretext='<table>' posttext='</table>'} ;
line '<tr><td>Term:</td><td>one</td></tr> ' ;
line '<tr><td>Campus:</td><td>two</td></tr> ';
line '<tr><td>College:</td><td>three</td></tr> ';
line '<tr><td>Discipline:</td><td>four</td></tr> ';
endcomp;
run ;
ods html close ;
Hope someone finds this useful.
Don