• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Cellular Insurance

Insuring your cell phone against loss or theft is a good tip, but instead let’s talk about ensuring that table cells have content. You already know that Netscape 4.x can have conniptions when a cell is left totally empty. You also know that if a table has a border set, empty cells don’t get the border and it looks terrible in Internet Explorer. When you’re dealing with a dynamically driven website, there is often the chance that some of the fields in the database won’t return any data. When this happens and there aren’t any other contents in a table cell, you could end up with a totally empty cell if a record is not returned. We can’t have that, now can we? Using an if/else statement, you can determine if a field is not empty the record should be shown; otherwise, show a non-breaking space or a display message you’ve entered—just don’t let that cell stay empty. Here’s some sample ColdFusion code for you to chew on:

<cfif recordset.theField NEQ "">
<cfoutput>#recordset.theField#</cfouput>
<cfelse>&nbsp;
</cfif>


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint