Solved

CSS style not displaying on Null values

Posted on 2006-11-14
7
166 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

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 …
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

920 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

15 Experts available now in Live!

Get 1:1 Help Now