Displaying Data w/o extra empty <td> cells

I will attach the code that I am working on.  Included are the query and the check boxes that are being displayed.  Currently the query is returning true for all of the checked fields, so all of them should be displaying.  My question is, how do I eliminate the extra table cells when the checkboxes are being displayed.  I am fairly sure that it involved using the queryname.RecordCount and evaluating if there is information for each record.  Please help, this is a biggy.

Attached Code:

<!--- displays all phone_display numbers = 1 --->
<CFQUERY NAME="ActionDisplayPhone" DATASOURCE="O2K_DEV">
SELECT      TD.TYPEDEF_ID, CP.TYPEDEF_ID, TD.TD_LABEL, CP.CONTACT_ID, CP.PHONE_DISPLAY,       
                  CP.PHONE_ID
FROM        TYPE_DEFINE TD, CONTACT_PHONE CP
WHERE       TD.TYPEDEF_ID = CP.TYPEDEF_ID AND (CP.PHONE_DISPLAY = 1) AND
                  CP.CONTACT_ID = 125 <!--- <<< CONTACT_ID --->
</CFQUERY>

  <table width=100%>
  <tr class="list">
<CFOUTPUT QUERY="ActionDisplayPhone">
<!--- <cfif ActionDisplayPhone.CurrentRow MOD #ActionDisplayPhone.RecordCount# is 1> --->
<!--- #ActionDisplayPhone.RecordCount#-#TYPEDEF_ID# --->
  <cfif #TYPEDEF_ID# is "105">
  <TD width=33%><INPUT TYPE="checkbox" NAME="personal800">Personal 800 Number</TD>
  <cfelse>
  <TD>&nbsp;</td>
  </cfif>
 
  <cfif #TYPEDEF_ID# is "110">
  <TD width=33%><INPUT TYPE="checkbox" NAME="personallocal">Personal Local Number</TD>
  <cfelse>
  <TD>&nbsp;</td>
  </cfif>
 
  <cfif #TYPEDEF_ID# is "101">      
  <TD width=33%><INPUT TYPE="checkbox" NAME="ophone">Office phone</TD>
  <cfelse>
  <TD>&nbsp;</td>
  </cfif>
 
   </tr>      
   <tr class="list">
   <cfif #TYPEDEF_ID# is "106">      
   <TD width=33%><INPUT TYPE="checkbox" NAME="ofoperator">Office Operator</TD>
   <cfelse>
   <TD width=33%>&nbsp;</td>
   </cfif>
   <cfif #TYPEDEF_ID# is "46">
   <TD width=33%><INPUT TYPE="checkbox" NAME="homephone">Home phone</TD>
   <cfelse>
   <TD width=33%>&nbsp;</td>
   </cfif>
   <cfif #TYPEDEF_ID# is "108">
   <TD width=33%><INPUT TYPE="checkbox" NAME="altphone">Alternate phone</TD>
   <cfelse>
   <TD width=33%>&nbsp;</td>
   </cfif>
      </tr>
   <TR class="list">
   <cfif #TYPEDEF_ID# is "48">
   <TD width=33%><INPUT TYPE="checkbox" NAME="fax">Fax</TD>
    <cfelse>
   <TD>&nbsp;</td>
   </cfif>
   <cfif #TYPEDEF_ID# is "50">
   <TD width=33%><INPUT TYPE="checkbox" NAME="mobile">Mobile</TD>
    <cfelse>
   <TD>&nbsp;</td>
   </cfif>
   <cfif #TYPEDEF_ID# is "49">
   <TD width=33%><INPUT TYPE="checkbox" NAME="pager" >Pager</TD>
    <cfelse>
   <TD>&nbsp;</td>
   </cfif>
   </TR>       
   
   <TR class="list">
   <cfif #TYPEDEF_ID# is "102">
   <TD width=33%><INPUT TYPE="checkbox" NAME="officephone2">Office Phone2</TD>
    <cfelse>
   <TD>&nbsp;</td>
   </cfif>
   <cfif #TYPEDEF_ID# is "47">
   <TD width=33%><INPUT TYPE="checkbox" NAME="voicemail">VoiceMail</TD>
    <cfelse>
   <TD>&nbsp;</td>
   </cfif>
     <TD>&nbsp;</td>
   </TR>       
<!--- </cfif> --->
 </CFOUTPUT>
    </table>
jerrykovachAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Nathan Stanford SrSenior ProgrammerCommented:
Quick Question

Are you saying that you want to get rid of any empty    

<td></td> 's


I am not sure I understand the problem

1. How are you wanting the outcome to look.  I think I have a solution but need to understand what you are wanting in the end.
0
jerrykovachAuthor Commented:
Yes, I would like to get rid of any empty td's and just display those cells which have data within them.  The outcome will be displayed in rows.  Three data cells per row.
0
Nathan Stanford SrSenior ProgrammerCommented:
Give me about 30 min and I will post an answer
0
Newly released Acronis True Image 2019

In announcing the release of the 15th Anniversary Edition of Acronis True Image 2019, the company revealed that its artificial intelligence-based anti-ransomware technology – stopped more than 200,000 ransomware attacks on 150,000 customers last year.

jerrykovachAuthor Commented:
Excellent, I really appreciate your help.
0
Nathan Stanford SrSenior ProgrammerCommented:
Use the below code
----------------------------


<!--- displays all phone_display numbers = 1 --->
<CFQUERY NAME="ActionDisplayPhone" DATASOURCE="O2K_DEV">
SELECT      TD.TYPEDEF_ID, CP.TYPEDEF_ID, TD.TD_LABEL, CP.CONTACT_ID, CP.PHONE_DISPLAY,
CP.PHONE_ID
FROM        TYPE_DEFINE TD, CONTACT_PHONE CP
WHERE       TD.TYPEDEF_ID = CP.TYPEDEF_ID AND (CP.PHONE_DISPLAY = 1) AND
CP.CONTACT_ID = 125 <!--- <<< CONTACT_ID --->
</CFQUERY>

  <table width=100%>
  <tr class="list">
<CFOUTPUT QUERY="ActionDisplayPhone">
<cfswitch expression="#TYPEDEF_ID">
<cfcase value="105">  
      <TD width=33%><INPUT TYPE="checkbox" NAME="personal800">Personal 800 Number</TD>
</cfcase>
<cfcase value="110">
        <TD width=33%><INPUT TYPE="checkbox" NAME="personallocal">Personal Local Number</TD>
</cfcase>
<cfcase value="101">
  <TD width=33%><INPUT TYPE="checkbox" NAME="ophone">Office phone</TD>
</cfcase>
<cfcase value="106">
   <TD width=33%><INPUT TYPE="checkbox" NAME="ofoperator">Office Operator</TD>
</cfcase>
<cfcase value="46">
   <TD width=33%><INPUT TYPE="checkbox" NAME="homephone">Home phone</TD>
</cfcase>
<cfcase value="108">
   <TD width=33%><INPUT TYPE="checkbox" NAME="altphone">Alternate phone</TD>
</cfcase>
<cfcase value="48">
   <TD width=33%><INPUT TYPE="checkbox" NAME="fax">Fax</TD>
</cfcase>
<cfcase value="50">
   <TD width=33%><INPUT TYPE="checkbox" NAME="mobile">Mobile</TD>
</cfcase>
<cfcase value="49">
   <TD width=33%><INPUT TYPE="checkbox" NAME="pager" >Pager</TD>
</cfcase>
<cfcase value="102">
   <TD width=33%><INPUT TYPE="checkbox" NAME="officephone2">Office Phone2</TD>
</cfcase>
<cfcase value="47">
   <TD width=33%><INPUT TYPE="checkbox" NAME="voicemail">VoiceMail</TD>
</cfcase>
</cfswitch>
<cfif ActionDisplayPhone.CurrentRow MOD  IS 3>    </tr>    <tr>  </cfif>
 </CFOUTPUT>
    </table>
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jerrykovachAuthor Commented:
I've used this service a few times before and that was by far the best answer I've received.  That was 100% dead on.  Thank you for the very fast reply also.  I will give you the highest marks possible.  Happy Holidays nathans!
0
Nathan Stanford SrSenior ProgrammerCommented:
Thank you!  If you have anymore ColdFusion Help Look me up as well as Experts-Exchange.

Nathan@nsnd.com
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.