8 Replies Latest reply on Jul 7, 2006 1:16 PM by BKBK

    Change cell color of query results,font size,style

    susanring Level 1
      Change cell color of query results,font size,style
      Hello
      I have this code below and I want to know if it is possible to make the column header a font style different
      Example:
      Font size =12
      Verdena
      blue
      And the cell of the column name a different color for ex
      Yellow


      Can this be done here and where in this code do I put it??

      Thank you so much


      <cfquery name="gelov datasource="kl90">
      SELECT
      -------------------------------------------

      FROM
      --------------------------------
      WHERE
      -----------------------------------------
      -----------------------------------------------------

      ORDER BY
      <cfswitch expression="#Form.orderBy#">
      <cfks value="KSNUMBER">
      KS.KS_NBR
      </cfks>
      <cfks value="CREATIONDATE">
      KS.KREATDAT
      </cfks>
      </cfswitch>
      </cfquery>

      <!---html report--->
      <cfswitch expression="#Form.outputFormat#">
      <cfks value="HTML">

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" " http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns=" http://www.w3.org/1999/xhtml">
      <head>
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <title>Ctwye Kss Report</title>
      </head>
      <style type="text/css">
      table{
      font-family:Arial, Helvetica, sans-serif;
      font-size:10px;
      }
      td{
      font-family:Arial, Helvetica, sans-serif;
      font-size:10px;
      }
      th{
      font-family:Arial, Helvetica, sans-serif;
      font-size:10px;
      }
      h2{
      font-family:Arial, Helvetica, sans-serif;
      font-size:12px;
      }
      h3{
      font-family:Arial, Helvetica, sans-serif;
      font-size:13px;
      }
      </style>

      <body>
      <cfoutput>
      <table border="0" cellpadding="3" cellspacing="0">
      <tr>

      <td align="center">
      <h3>Ctwye Kss Report</h3><br><br></td>
      </tr>
      <tr>
      <td align="center">
      </h2>report returned #getCtwyeKss.RecordCount# records</h2></td>
      </tr>
      <tr>
      <td>
      <table border="1" cellpadding="2" cellspacing="0">
      <tr>

      <td width="160">Ks Number</td>
      <td>K-date</td>
      <!--- <td class="dataField">Address</td>
      <td class="dataField">Type</td>
      <td class="dataField">Description</td>--->
      </tr>

      <cfloop query="getCtwyeKss">


      <tr bgcolor="<cfif currentrow mod 2>GHOSTWHITE<cfelse>WHITE</cfif>">
      <td>#KS_NBR#</td>
      <td>#dateformat(KREATDAT,"mm/dd/yyyy")#</td>


      </tr>
      </cfloop>

      </table>
      </td>
      </tr>
      </table>

      </BODY>
      </HTML>
      </cfoutput>
      </cfks>

      <cfks value="CSV">


      <CFHEADER NAME="Content-Disposition" VALUE="attachment; filename=ctwye.csv">
      <cfcontent type="application/msexcel">"Ks Number","K-date"
      <cfoutput query="getCtwyeKss">#ltrim(KS_NBR)#,"#dateformat(KREATDAT,"mm/dd/yyyy")#" <tr #IIF(getCtwyeKss.CurrentRow MOD 2,DE(''),DE('backgroundColor="##999"'))#>



      <!---<tr bgcolor="<cfif currentrow mod 2>##808080<cfelse>##ffffff</cfif>"> --->
      </cfoutput>


      </cfks>
      </cfswitch>