Solved

CSS style not displaying on Null values

Posted on 2006-11-14
7
169 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
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Time Sheet Help 6 54
Redirect website ! 4 54
question about access to website 2 74
setup wamp server for first time 2 67
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 …
In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

813 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

11 Experts available now in Live!

Get 1:1 Help Now