<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: proc template  --- give different background color to different columns in a table in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/proc-template-give-different-background-color-to-different/m-p/135644#M36667</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Cynthia! It works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 18 Mar 2014 15:05:35 GMT</pubDate>
    <dc:creator>esl37</dc:creator>
    <dc:date>2014-03-18T15:05:35Z</dc:date>
    <item>
      <title>proc template  --- give different background color to different columns in a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-template-give-different-background-color-to-different/m-p/135640#M36663</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to give different background colors to different columns in a table by using proc template. Does anyone have experience on it?&lt;/P&gt;&lt;P&gt;I tried to use below codes. But the program only changed the backgrounds of the body of the table. The background color of the headers is still the same.&lt;/P&gt;&lt;P&gt;proc template;&lt;/P&gt;&lt;P&gt;/*--------------------------*/&lt;/P&gt;&lt;P&gt;/* Table definition&lt;/P&gt;&lt;P&gt;/*--------------------------*/&lt;/P&gt;&lt;P&gt;define table mytable;&lt;/P&gt;&lt;P&gt;&amp;nbsp; column a b c ;&lt;/P&gt;&lt;P&gt;center=on;&lt;/P&gt;&lt;P&gt;/*-------------------------------------*/&lt;/P&gt;&lt;P&gt;/* Set up the headers of each variable&lt;/P&gt;&lt;P&gt;/*-------------------------------------*/&amp;nbsp; &lt;/P&gt;&lt;P&gt;define a ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; header='AAA' style=[background=red]&lt;/P&gt;&lt;P&gt;&amp;nbsp; just=center;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;define a ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; header='BBB' style=[background=blue]&lt;/P&gt;&lt;P&gt;&amp;nbsp; just=center;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;define a ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; header='CCC' style=[background=yellow]&lt;/P&gt;&lt;P&gt;&amp;nbsp; just=center;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2014 20:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-template-give-different-background-color-to-different/m-p/135640#M36663</guid>
      <dc:creator>esl37</dc:creator>
      <dc:date>2014-03-06T20:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: proc template  --- give different background color to different columns in a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-template-give-different-background-color-to-different/m-p/135641#M36664</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I see repeated "Define A" statements, not a Define header. Also you may need a Define Column.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2014 21:00:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-template-give-different-background-color-to-different/m-p/135641#M36664</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-03-06T21:00:38Z</dc:date>
    </item>
    <item>
      <title>Re: proc template  --- give different background color to different columns in a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-template-give-different-background-color-to-different/m-p/135642#M36665</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;You are correct, slightly different syntax is needed to style a whole column vs the style for a header. This paper shows some of the techniques, at least enough to get the OP started.&lt;/P&gt;&lt;P&gt;&lt;A href="http://www2.sas.com/proceedings/sugi30/088-30.pdf" title="http://www2.sas.com/proceedings/sugi30/088-30.pdf"&gt;http://www2.sas.com/proceedings/sugi30/088-30.pdf&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Mar 2014 21:57:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-template-give-different-background-color-to-different/m-p/135642#M36665</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-03-06T21:57:15Z</dc:date>
    </item>
    <item>
      <title>Re: proc template  --- give different background color to different columns in a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-template-give-different-background-color-to-different/m-p/135643#M36666</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, something bothered me about the OP code. There weren't enough END statements -- so the originally posted code should be getting an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG style="color: #ff0000;"&gt;ERROR: Parse environments were left open. You might be missing an END statement.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Had a chance to modify the example.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cynthia&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods path work.tmp(update) sasuser.templat(update)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sashelp.tmplmst(read);&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** you can define header text and style in the define block;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** for the column;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** then the simple style= in the define block refers to the datacells;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;** and cellstyle ...as refers to the data cells;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;proc template;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #0000ff;"&gt;define&lt;/SPAN&gt; table mytable;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; column a b c ;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; center=on;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #ff6600;"&gt;&amp;nbsp;&amp;nbsp; define&lt;/SPAN&gt; a ;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #ff00ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; define&lt;/SPAN&gt; header ahd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text 'AAA';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style={background=red};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #ff00ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; header=ahd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; style={background=pink};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; just=center;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #ff6600;"&gt;&amp;nbsp; end&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #ff6600;"&gt;&amp;nbsp; define&lt;/SPAN&gt; b ;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #ff00ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; define&lt;/SPAN&gt; header bhd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text 'BBB';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style={background=blue};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #ff00ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; header=bhd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cellstyle _val_ le 3 as [background=lightgreen],&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _val_ le 5 as {background=lightblue},&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _val_ ge 6 as {background=graycc foreground=red font_weight=bold};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; just=center;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #ff6600;"&gt;&amp;nbsp; end&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #ff6600;"&gt;&amp;nbsp; define&lt;/SPAN&gt; c ;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #ff00ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; define&lt;/SPAN&gt; header chd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; text 'CCC';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; style={background=yellow};&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #ff00ff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; end&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; header=chd;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; style=[background=lightyellow]&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; just=center;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #ff6600;"&gt;&amp;nbsp; end&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&lt;SPAN style="color: #3366ff;"&gt;end&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;BR /&gt;&lt;SPAN style="color: #008000;"&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods listing close;&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html file='c:\temp\maketable.html';&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;data _null_;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;set sashelp.class;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; keep&amp;nbsp; a b c;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; a = name;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; b= age - 10;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; c=height*weight;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; file print ods=(template='mytable');&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;&amp;nbsp; put _ods_;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;run;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG style="font-family: courier new,courier;"&gt;ods html close;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;BR /&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/11452iFB027040CE149034/image-size/large?v=1.0&amp;amp;px=600" border="0" alt="changing_header_and_column_in_table_template.png" title="changing_header_and_column_in_table_template.png" /&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Mar 2014 00:47:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-template-give-different-background-color-to-different/m-p/135643#M36666</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2014-03-07T00:47:53Z</dc:date>
    </item>
    <item>
      <title>Re: proc template  --- give different background color to different columns in a table</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/proc-template-give-different-background-color-to-different/m-p/135644#M36667</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you Cynthia! It works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Mar 2014 15:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/proc-template-give-different-background-color-to-different/m-p/135644#M36667</guid>
      <dc:creator>esl37</dc:creator>
      <dc:date>2014-03-18T15:05:35Z</dc:date>
    </item>
  </channel>
</rss>

