Solved

CSS style not displaying on Null values

Posted on 2006-11-14
7
178 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Connect further...control easier

With the ATEN CE624, you can now enjoy a high-quality visual experience powered by HDBaseT technology and the convenience of a single Cat6 cable to transmit uncompressed video with zero latency and multi-streaming for dual-view applications where remote access is required.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

696 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