Modify Table Display

I have a web page that displays fleet information from a database by district. Each district has a variable number of fleets, and each fleet has a variable number of contact lines:
  <div id="fleetInfo">
          <table>
            <% While ((Repeat2__numRows <> 0) AND (NOT rsfleetOfficers.EOF)) %>
              <tr>
                <td width="450"><%=(rsfleetOfficers.Fields.Item("fleet").Value)%></td>
                <td width="220"><%=(rsfleetOfficers.Fields.Item("name").Value)%></td>
            </tr>
              <%
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  rsfleetOfficers.MoveNext()
Wend
%>
          </table>
  </div>
Each record also contains a fleet number. I would like to create extra spacing between each fleet grouping, and/or, preferably, draw a horizontal line (or activate a black bottom border on the cells for the last record in the grouping). I'm looking for coding help to accomplish this.
slegyAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
John Mc HaleConnect With a Mentor Forensic Computer Examiner, Analyst/Programmer & Database ArchitectCommented:
I am not familiar with the syntax of the preprocessor/interpreter being used, but what you need to do is initialize a variable to a non-existing fleet #, prior to reading the first fleet record, s.t.



<div id="fleetInfo">
          <table>
***** CurrentFleetHash = -1?
            <% While ((Repeat2__numRows <> 0) AND (NOT rsfleetOfficers.EOF)) %>
              <tr>
                <td width="450"><%=(rsfleetOfficers.Fields.Item("fleet").Value)%></td>
                <td width="220"><%=(rsfleetOfficers.Fields.Item("name").Value)%></td>
            </tr>
*********** Now you need to test for change in fleet # using the syntax of the language you are using
***** If CurrentFleetHash <>(rsfleetOfficers.Fields.Item("fleet").Value) Then **** output <hr> and update CurrentFleetHash
<hr>
CurrentFleetHash = (rsfleetOfficers.Fields.Item("fleet").Value)
              <% 
  Repeat2__index=Repeat2__index+1
  Repeat2__numRows=Repeat2__numRows-1
  rsfleetOfficers.MoveNext()
Wend
%>
          </table>
  </div>

Open in new window

0
 
John Mc HaleForensic Computer Examiner, Analyst/Programmer & Database ArchitectCommented:
<hr> </hr> will create a horizontal line whereever you want it!
0
 
John Mc HaleForensic Computer Examiner, Analyst/Programmer & Database ArchitectCommented:
Apologies, that should just be the <hr> HTML tag; </hr> is not required
0
 
slegyAuthor Commented:
I'm looking for a little direction for the code that would check for a change in fleet # prior to drawing the horizontal line.
0
 
slegyAuthor Commented:
Thank you for your help. I don't have any problems with the logic - it's the crazy syntax that gives me fits. I had to make some coding changes, i.e., the
cannot be enclosed in the <% %>. But I truly appreciate your setting me in the right direction. It was the solution I was looking for.
0
All Courses

From novice to tech pro — start learning today.