• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Change cell color of query results,font size,style

Community Beginner ,
Jul 07, 2006 Jul 07, 2006

Copy link to clipboard

Copied

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>
TOPICS
Advanced techniques

Views

714

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Jul 07, 2006 Jul 07, 2006
there is a suggestion in your other thread

Votes

Translate

Translate
New Here ,
Jul 07, 2006 Jul 07, 2006

Copy link to clipboard

Copied

By using <TH> instead of <TD> on your header row you can then specify different font type and size in your CSS code.

th{
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
}

I'm guessing this is your header?

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

If so, change these <TD> to <TH>

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


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 07, 2006 Jul 07, 2006

Copy link to clipboard

Copied

thanks
i did change to td.

but the results is the same.


where do i put the change in font style and size and if it is bold or italic
thanks


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jul 07, 2006 Jul 07, 2006

Copy link to clipboard

Copied

BTW -- you can also change each row of your table to alternate colors by using this on your <TR> where you want the change to occur:

<TR bgcolor="###IIF(QueryName.CurrentRow MOD 2, DE('DCDCDC'), DE('FFFFFF'))#">

That will alternate your rows between gray and white. You can change them to any color you want.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 07, 2006 Jul 07, 2006

Copy link to clipboard

Copied

thanks
where do i put it in the code:
will it replace


<tr bgcolor="<cfif currentrow mod 2>GHOSTWHITE<cfelse>WHITE</cfif>">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 07, 2006 Jul 07, 2006

Copy link to clipboard

Copied

<cfks> is not a Coldfusion tag. Use <cfcase> instead.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 07, 2006 Jul 07, 2006

Copy link to clipboard

Copied

OK,
changed to cfcase.




how do i change the cell color. and the font size ztyle and bold or italic.

thanks


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jul 07, 2006 Jul 07, 2006

Copy link to clipboard

Copied

OK,
changed to cfcase.




how do i change the cell color. and the font size ztyle and bold or italic.

thanks


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 07, 2006 Jul 07, 2006

Copy link to clipboard

Copied

LATEST
there is a suggestion in your other thread

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation