Solved

CSS style not displaying on Null values

Posted on 2006-11-14
7
165 Views
Last Modified: 2013-12-24
I am working on this web report for my company using Coldfusion and CSS style sheet.  Whenever a column on the report is displaying a null value the underline on the CSS style sheet doesn't appear.  How do I get the bottom line of the CSS style sheet to appear on NUll values in the report.  Below is my code

<cfoutput query="dsprpt">
      <cfif (#dsprpt.currentrow# mod 2) EQ 0>
        <tr class="tr_evenrow"> <cfelse> <tr>
      </cfif>
      <td class="tdstart"><a href=".../coop/phase2/preapprove/dsp_update.cfm?Preapproval_ID=#Preapproval_ID#" target="_blank">#dsprpt.Preapproval_ID#</a></td>
      <td class="tdstart">#dsprpt.Vendor#</td>
      <td class="tdstart">#dateformat(dsprpt.Date_PreApproval,'MM/DD/YYYY')#</td>
      <td class="tdstart">#dsprpt.Coordinator#</td>      
      <td class="tdstart">#dsprpt.ContactName#</td>      
      <td class="tdstart">#dsprpt.Fax#</td>            
      <td class="tdstart">#dsprpt.Email#</td>                  
      <td class="tdstart">#dollarformat(dsprpt.ExpectedCost)#</td>
      <td class="tdstart">#dsprpt.EntryCode#</td>
      <td class="tdstart">#dsprpt.PricePoint#</td>
      <td class="tdstart">#dsprpt.Status#</td>
      <td class="tdstart">#dsprpt.Notes#</td>
      <td class="tdstart">#dateformat(dsprpt.Date_Received,'MM/DD/YYYY')#</td>
      <td class="tdstart">#dsprpt.ActionUser#</td>      
      <td class="tdstart">#dsprpt.ActionDate#</td>      
</tr>      
      </cfoutput></table>
      </tr></td>
  </table>
      </div>
0
Comment
Question by:rudodoo
  • 3
  • 3
7 Comments
 
LVL 9

Assisted Solution

by:73Spyder
73Spyder earned 400 total points
ID: 17941134
You might could check for nulls and if so put a space in like this:

 <td class="tdstart">
   <cfif len(dsprpt.Vendor) GT 0>#dsprpt.Vendor#<cfelse>&nbsp;</cfif>
</td>


That way there is something in the output instead of an empty string.
0
 

Author Comment

by:rudodoo
ID: 17941184
Will that effect the table that the insert form uses to insert records into the the database.
0
 

Author Comment

by:rudodoo
ID: 17941218
Also tdclass on the style sheet is defined as


.tdstart {
      padding: 3px 8px;
      text-align:right;
      border-bottom: 1px solid #999999;
}
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 20

Expert Comment

by:trailblazzyr55
ID: 17941225
you don't really need to check against a value, you can just keep it short and do this...

<cfif len(trim(dsprpt.Vendor))>#dsprpt.Vendor#<cfelse>&nbsp;</cfif>
0
 
LVL 20

Accepted Solution

by:
trailblazzyr55 earned 100 total points
ID: 17941253
a <td> will not display unless it has content, this is why your styles didn't show for it, and that is why in the absence of content for a <td> you need to give it at least the space "&nbsp;"

<cfif len(trim(dsprpt.Vendor))>#dsprpt.Vendor#<cfelse>&nbsp;</cfif>
             check for content         if content show        else give it a space for filler
0
 
LVL 20

Expert Comment

by:trailblazzyr55
ID: 17941310
you asked: "Will that effect the table that the insert form uses to insert records into the the database."

if I understand you question correctly then no, the space is just for display purposes and to get the style to display properly in the column in the absence of content returned from the query for that given field.

if you have hidden fields or forms vars dependant on the values returned from your query, it'll just update again with a null when you submit, you don't need spaces there, just for display...
0
 

Author Comment

by:rudodoo
ID: 17941368
That worked great I appreciate it
0

Featured Post

Scale it in WD Gold

With up to ten times the workload capacity of desktop drives, WD Gold hard drives employ advanced technology to deliver among the best in reliability, capacity, power efficiency and performance.

Join & Write a Comment

This is a guide to setting up a new WHM/cPanel Server to be used for web hosting accounts. It is intended for web hosting company administrators and dedicated server owners. For under $99 per month (considering normal rate of Big Data Cetnters like …
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now