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?
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.

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
John Mc HaleForensic 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

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
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
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 Applications

From novice to tech pro — start learning today.