Date: Wed, 5 Sep 2007 10:13:44 -0400
Reply-To: Chang Chung <chang_y_chung@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Chang Chung <chang_y_chung@HOTMAIL.COM>
Subject: Re: Modify a tagset(PHTML) or style(meadow)?
On Wed, 5 Sep 2007 04:02:50 -0400, Richard A. DeVenezia
<rdevenezia@WILDBLUE.NET> wrote:
>Destination PHTML and style MEADOW are used to render a tabulation. One of
>the CLASSLEV is using style asis=yes. In PHTML asis=yes causes the class
>level to be wrapped in a PRE tag.
>
>A PRE tag by default displays in block mode -- which means extra space is
>drawn below the content.
>
>If the PRE tag is tweaked with css
> pre { display:inline }
>the extra space goes away.
>
>--------------------------
>data foo;
> do a = 1 to 3;
> do b = 1 to 3;
> z+1;
> output;
> end;
> end;
>run;
>
>ods phtml file="%sysfunc(pathname(WORK))\demo.html" style=meadow;
>
>proc format;
> value b
> 1 = 'This is one'
> 2 = 'This is two'
> 3 = ' This is three'
> ;
>
>proc tabulate data=foo format=4.;
> class a b;
> classlev b / style=[asis=yes];
> var z;
> table a*b,z*(min max);
>run;
>
>ods phtml close;
>--------------------------
>
>I'm thinking of changing the code to use a descendant of meadow
>
> ods phtml file="%sysfunc(pathname(WORK))\demo.html" style=MYmeadow;
>
>which has an additional css style declaration
>
> pre { display:inline }, or
> table pre { display:inline }, or
> rowheader pre { display:inline }
>
>What Proc TEMPLATE (or other Proc) code would be needed to create MYmeadow ?
hi,
I don't know how to do that with modifying styles, especially when styling
output for those four in(famous) procs. It is relatively straight forward if
you modify your tagsets. Here I am just overwriting alignstyle event to put
the style for pre tag at the bottom. HTH.
Cheers,
Chang
<sasl:code ver="9.1.3" sp="4" sysscp="WIN" sysscpl="XP_PRO">
data foo;
do a = 1 to 3;
do b = 1 to 3;
z+1;
output;
end;
end;
run;
ods path (prepend) work.myTmp(update);
proc template;
define tagset myTmp.myPhtml;
parent = tagsets.phtml;
/* overwriting alignstyle event in order to add
style definition for pre */
define event alignstyle;
putl ".l {text-align: left }";
putl ".c {text-align: center }";
putl ".r {text-align: right }";
putl ".d {text-align: ""."" }";
putl ".t {vertical-align: top }";
putl ".m {vertical-align: middle }";
putl ".b {vertical-align: bottom }";
putl "TD, TH {vertical-align: top }";
putl ".stacked_cell{padding: 0 }";
putl "pre {display:inline}";
end;
end;
run;
ods myTmp.myPhtml file="%sysfunc(pathname(WORK))\demo.html" style=meadow;
proc format;
value b
1 = 'This is one'
2 = 'This is two'
3 = ' This is three'
;
run;
proc tabulate data=foo format=4.;
class a b;
classlev b / style=[asis=yes];
var z;
table a*b,z*(min max);
format b b.; /* did you mean to include this line? */
run;
ods myTmp.myPhtml close;
ods path reset;
</sasl:code>