Separate results into multiple table sequence (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


nettop -> Separate results into multiple table sequence (3/29/2008 14:48:21)

I am using the DRW to generate results of a database at http://www.foothillbiz4sale.com/donedeals.asp . Instead of showing the results in one continuous table, I'd like to separate the data and show 3 tables per row, with a space and repeat another 3 tables in the next row showing unique data ID in each of the tables. Hopefully, you can see that I just want to format my results differently but don't know how I can put them in separate, repeating tables. Please help. Thanks, Tim




BeTheBall -> RE: Separate results into multiple table sequence (3/29/2008 21:34:53)

Here's a little example I threw together. I have bolded the key points. The key is to make the starting count and the number following "mod" be the same. If in my example below you change the number 3 to 4 each time it occurs, you will get 4 items per row. Hope this helps.

<!--#include file="_fpclass/fpdblib.inc"-->
<%
fp_sQry="SELECT * FROM Results"
fp_sDefault=""
fp_sNoRecords="No records returned."
fp_sDataConn="test"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_sColTypes="&ID=3&Type=202&Make=202&Model=202&YearBuilt=202&Color=202&Mileage=202&Classification=202&Price=3&BookValue=3&1-5 rating=3&"
fp_iDisplayCols=11
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
count=3
%>
<table cellspacing="5" cellpadding="5">
<tr>
<td>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<%
count=count+1
if count mod 3 = 1 then
response.write("</td></tr><td>")
else
response.write("</td><td>")
end if
%>
<table border="1">
  <tr>
    <td><b>ID:</b></td>
    <td>
    <%=FP_FieldVal(fp_rs,"ID")%> </td>
  </tr>
  <tr>
    <td><b>Type:</b></td>
    <td>
    <%=FP_FieldVal(fp_rs,"Type")%> </td>
  </tr>
  <tr>
    <td><b>Make:</b></td>
    <td>
    <%=FP_FieldVal(fp_rs,"Make")%> </td>
  </tr>
  <tr>
    <td><b>Model:</b></td>
    <td>
    <%=FP_FieldVal(fp_rs,"Model")%> </td>
  </tr>
</table>
<!--#include file="_fpclass/fpdbrgn2.inc"-->
</td>
</tr>
</table>




nettop -> RE: Separate results into multiple table sequence (3/30/2008 1:05:17)

Very cool!!! It worked perfectly. Now, I just need a little formatting. THANKS so much for your help. You can see the first (not formatted yet) results at http://www.foothillbiz4sale.com/donedeals.asp . Thanks again...I really appreciate your insights and help, Tim




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
8.007813E-02