• 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
Getting started

Views

598

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


In the style tag, change the properties of the "th" selector to:

th {
font-family: Verdana,Arial,Helvetica,Futura,Sans-serif;
font-size:12px;
font-weight: bold;
color: blue;
}

Then add headers as follows. Replace the table tags

<table border="0" cellpadding="3" cellspacing="0">

and

<table border="1" cellpadding="2" cellspacing="0">

respectivel...

Votes

Translate

Translate
Community Expert ,
Jul 07, 2006 Jul 07, 2006

Copy link to clipboard

Copied

You seem to ignore a suggestion I made elsewhere. Your code wont go anywhere if you don't make one correction. <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

it is now replaced

how do i change the cell color, font size and the style
for example verdana, italic blue font, yello cell

where do i put the code in this code???

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
Explorer ,
Jul 07, 2006 Jul 07, 2006

Copy link to clipboard

Copied

it is now replaced

how do i change the cell color, font size and the style
for example verdana, italic blue font, yello cell

where do i put the code in this code???

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

it is now replcaed cfcase


how do i change the cell color, font size and the style
for example verdana, italic blue font, yello cell

where do i put the code in this code???

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


In the style tag, change the properties of the "th" selector to:

th {
font-family: Verdana,Arial,Helvetica,Futura,Sans-serif;
font-size:12px;
font-weight: bold;
color: blue;
}

Then add headers as follows. Replace the table tags

<table border="0" cellpadding="3" cellspacing="0">

and

<table border="1" cellpadding="2" cellspacing="0">

respectively, with something like

<table border="0" cellpadding="3" cellspacing="0">
<tr>
<th>Report</th>
</tr>

and

<table border="1" cellpadding="2" cellspacing="0">
<tr>
<th>Number</th>
<th>Date</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
Resources
Documentation