1

Previously asked this, extra html that I did not write and thought I had solved it. There were two problems; I got rid first one and identified the line of code which is causing the 2nd problem, but I just can't figure out why, or what to do about it.

The problem code:
This part is okay, but it may be connected

     <!--- pageheadings --->
      </cfloop>  
      <cfloop from = "1" to = "#subpage#" index = "j">
      <cfif pagedup[currentrow] EQ "NO" and j EQ 1>
      <tr class = "page-break">    
      </cfif>
      </cfloop>              

      <td class = "repsort subhead">            
        <cfloop from = "1" to = "#subpage#" index = "j"> 
        <cfset col = bbcol[j]>
           <cfif pagedup[currentrow] EQ "NO">               
           #sortbef[j]# <b> #qrep[col][row]# </b> #sortaft[j]#
           </cfif>     
        </cfloop>
       </td> 
       </tr>  

I've moved the last </tr> to various places, but there is no effect at all.

Line 45 is appearing even though I want it only when the condition = NO. When condition is NO the stuff on line ** is printing; otherwise the line is printing anyway without that stuff. A problem because it is putting a row between lines that ought to be together (see output below). I think that there should be a tr tag at the beginning and end of this, but the output is the same whether I put it there or not.

     <!--- subheadings --->         
     <td class = "repsort2 subhead ">at line 45 
     <cfloop from = "#subpage1#" to = "#subhind_1#" index = "j">
     j #j# row #row# #subhdup[j][row]#
     <cfset col = bbcol[j]>
         <cfif subhdup[j][row] EQ "NO">
         #sortbef[j]# <b> #qrep[col][row]#</b> #sortaft[j]#     **
         </cfif>    
      </cfloop>
      </td>

Here is what Firebug is showing:

  <tbody>
  <tr class="page-break">
 <td class="repsort subhead">
 </tr>
 <tr>
<td class="repsort2 subhead ">
</tr>
<tr>
<td>  </td>
<td class="reprow" style="text-align: left; "> Maura</td>
<td class="reprow" style="text-align: left; "> Cronin</td>
<td class="repsort subhead"> </td>
</tr>

I can't figure out where this is coming from:

<tr>
<td class="repsort2 subhead ">at line 45 j 2 row 2 YES </td>
</tr>    

This is as it should be

<tr>
<td>  </td>
<td class="reprow" style="text-align: left; "> Dov</td>
<td class="reprow" style="text-align: left; "> Grunschlag</td>
<td class="repsort subhead"> </td>
</tr>

The output problem:

State: CA
at line 45 j 2 row 1 NO Zip3: 941
Maura Cronin
at line 45 j 2 row 2 YES     this line should not be here
Dov Grunschlag
at line 45 j 2 row 3 NO Zip3: 943
Ruth Hodos
State: CT

For those who helped before, sorry I said I had solved it. I had found the bad line, and figured it would be simple from there. But I am baffled. To the person who said this is a whitespace problem and I said no -- it is a whitespace problem now. Sorry.

Community
  • 1
  • 1
Betty Mock
  • 1,373
  • 11
  • 23
  • You need to have the same conditional you do to show the closing `tr` as you do the opening `tr` – Matt Busche Dec 28 '13 at 20:46
  • @MattBusche Turns out I needed a conditional before line 45. It looks like HTML is creating – Betty Mock Dec 28 '13 at 22:44
  • HTML is not creating tr tags for you. You are creating them. In the first block of code, which you say is OK, you have a tr tag inside a loop, but the closing tag is not. – Dan Bracuk Dec 29 '13 at 14:33
  • @DanBracuk yes, I was creating them. It was not the placement of the tr tag, however(which I have since corrected). It was that I needed a condition before I started the loop. The extra HTML was from cases that shouldn't have been in the loop. It sure took a long time to see that. – Betty Mock Dec 31 '13 at 02:44

0 Answers0