Link to home
Start Free TrialLog in
Avatar of jvescio
jvescio

asked on

Repeat <thead> every 10 rows...SQL 2000 / ASP

I would like to repeat the column heading every 10 rows on the results page of a SQL 2000 query. Does anyone have experience with this?

Here is my HEADER ROW...

   <thead>
          <tr>
            <td bgcolor="#000080"><font color="#FFFFFF" size="1" face="Arial">
            <b>ID</b></font></td>
            <td bgcolor="#000080"><b>
            <font face="Arial" size="1" color="#FFFFFF">EDIT</font></b></td>
            <td bgcolor="#000080"><font color="#FFFFFF" size="1" face="Arial">
            <b>Last Name</b></font></td>
            <td bgcolor="#000080"><font color="#FFFFFF" size="1" face="Arial">
            <b>First Name</b></font></td>
          </tr>
        </thead>
Thanks!!
ASKER CERTIFIED SOLUTION
Avatar of CRagsdell
CRagsdell

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CRagsdell
CRagsdell

Ooops, take out the </thead> tag in the details line...

and there is a typo in "If left out the rest..."

It should read "I left out the rest..."

CR
Avatar of jvescio

ASKER

Thanks for responding,

Are you saying this code replaces my current query completely?  If so, where would code reside?  Above the head tag? In the body?

JV
Use your current query, as this was just an example of how the looping and counting of 10 lines between each <thead></thead> would work.

Just noticed, you might have to replace the "If strCounter <> 10 Then" line with "If strCounter <> 9 Then" since I am resetting to 0 after each 10 records.

Run the query anywhere on your page prior to where you want to show the results. Where you are now showing the results, use my sample (revised as necessary to meet your needs) to build the parts of the table where you want the header to repeat.

CR
what language are you using?
Avatar of jvescio

ASKER

I am using ASP and SQL Server 2000.

I am editin code generated by Frontpage 2002.

Here is an example:

<html>

<head>
<% ' FP_ASP -- ASP Automatically generated by a Frontpage Component. Do not Edit.
FP_CharSet = "windows-1252"
FP_CodePage = 1252 %>
</head>

<body>


<table width="100%" border="1">
  <thead>
    <tr>
      <td><b>ID</b></td>
      <td><b>lastname</b></td>
      <td><b>firstname</b></td>
      <td><b>pw</b></td>
      <td><b>username</b></td>
      <td><b>dept</b></td>
    </tr>
  </thead>
  <tbody>
  <!--webbot bot="DatabaseRegionStart" s-columnnames="ID,lastname,firstname,pw,username,dept,manager,costcenter,bizunit,address1,address2,city,state,zip,homephone,cube_num,fax,email,location,did,present_num,cell_num,state_exemptions,fed_exemptions,bday,SecurityLevel,status,fullname,street_address,remote_fax_num" s-columntypes="3,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202,202" s-dataconnection="employees" b-tableformat="TRUE" b-menuformat="FALSE" s-menuchoice s-menuvalue b-tableborder="TRUE" b-tableexpand="TRUE" b-tableheader="TRUE" b-listlabels="TRUE" b-listseparator="TRUE" i-listformat="0" b-makeform="TRUE" s-recordsource="employees" s-displaycolumns="ID,lastname,firstname,pw,username,dept" s-criteria s-order s-sql="SELECT * FROM employees" b-procedure="FALSE" clientside suggestedext="asp" s-defaultfields s-norecordsfound="No records returned." i-maxrecords="256" i-groupsize="5" botid="0" u-dblib="_fpclass/fpdblib.inc" u-dbrgn1="_fpclass/fpdbrgn1.inc" u-dbrgn2="_fpclass/fpdbrgn2.inc" tag="TBODY" preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the start of a Database Results region. The page must be fetched from a web server with a web browser to display correctly; the current web is stored on your local disk or network.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;" startspan --><!--#include file="_fpclass/fpdblib.inc"-->
<% if 0 then %>
<SCRIPT Language="JavaScript">
document.write("<div style='background: yellow; color: black;'>The Database Results component on this page is unable to display database content. The page must have a filename ending in '.asp', and the web must be hosted on a server that supports Active Server Pages.</div>");
</SCRIPT>
<% end if %>
<%
fp_sQry="SELECT * FROM employees"
fp_sDefault=""
fp_sNoRecords="<tr><td colspan=6 align=left width=""100%"">No records returned.</td></tr>"
fp_sDataConn="employees"
fp_iMaxRecords=256
fp_iCommandType=1
fp_iPageSize=5
fp_fTableFormat=True
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=6
fp_fCustomQuery=False
BOTID=0
fp_iRegion=BOTID
%>
<!--#include file="_fpclass/fpdbrgn1.inc"-->
<!--webbot bot="DatabaseRegionStart" endspan i-checksum="53682" -->
  <tr>
    <td>
    <!--webbot bot="DatabaseResultColumn" s-columnnames="ID,lastname,firstname,pw,username,dept,manager,costcenter,bizunit,address1,address2,city,state,zip,homephone,cube_num,fax,email,location,did,present_num,cell_num,state_exemptions,fed_exemptions,bday,SecurityLevel,status,fullname,street_address,remote_fax_num" s-column="ID" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;ID&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"ID")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="62813" --></td>
    <td>
    <!--webbot bot="DatabaseResultColumn" s-columnnames="ID,lastname,firstname,pw,username,dept,manager,costcenter,bizunit,address1,address2,city,state,zip,homephone,cube_num,fax,email,location,did,present_num,cell_num,state_exemptions,fed_exemptions,bday,SecurityLevel,status,fullname,street_address,remote_fax_num" s-column="lastname" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;lastname&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"lastname")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="16593" --></td>
    <td>
    <!--webbot bot="DatabaseResultColumn" s-columnnames="ID,lastname,firstname,pw,username,dept,manager,costcenter,bizunit,address1,address2,city,state,zip,homephone,cube_num,fax,email,location,did,present_num,cell_num,state_exemptions,fed_exemptions,bday,SecurityLevel,status,fullname,street_address,remote_fax_num" s-column="firstname" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;firstname&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"firstname")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="21016" --></td>
    <td>
    <!--webbot bot="DatabaseResultColumn" s-columnnames="ID,lastname,firstname,pw,username,dept,manager,costcenter,bizunit,address1,address2,city,state,zip,homephone,cube_num,fax,email,location,did,present_num,cell_num,state_exemptions,fed_exemptions,bday,SecurityLevel,status,fullname,street_address,remote_fax_num" s-column="pw" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;pw&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"pw")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="6301" --></td>
    <td>
    <!--webbot bot="DatabaseResultColumn" s-columnnames="ID,lastname,firstname,pw,username,dept,manager,costcenter,bizunit,address1,address2,city,state,zip,homephone,cube_num,fax,email,location,did,present_num,cell_num,state_exemptions,fed_exemptions,bday,SecurityLevel,status,fullname,street_address,remote_fax_num" s-column="username" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;username&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"username")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="19455" --></td>
    <td>
    <!--webbot bot="DatabaseResultColumn" s-columnnames="ID,lastname,firstname,pw,username,dept,manager,costcenter,bizunit,address1,address2,city,state,zip,homephone,cube_num,fax,email,location,did,present_num,cell_num,state_exemptions,fed_exemptions,bday,SecurityLevel,status,fullname,street_address,remote_fax_num" s-column="dept" b-tableformat="TRUE" b-hashtml="FALSE" b-makelink="FALSE" clientside b-MenuFormat preview="&lt;font size=&quot;-1&quot;&gt;&amp;lt;&amp;lt;&lt;/font&gt;dept&lt;font size=&quot;-1&quot;&gt;&amp;gt;&amp;gt;&lt;/font&gt;" startspan --><%=FP_FieldVal(fp_rs,"dept")%><!--webbot bot="DatabaseResultColumn" endspan i-checksum="5853" --></td>
  </tr>
  <!--webbot bot="DatabaseRegionEnd" b-tableformat="TRUE" b-menuformat="FALSE" u-dbrgn2="_fpclass/fpdbrgn2.inc" i-groupsize="5" clientside tag="TBODY" preview="&lt;tr&gt;&lt;td colspan=64 bgcolor=&quot;#FFFF00&quot; align=&quot;left&quot; width=&quot;100%&quot;&gt;&lt;font color=&quot;#000000&quot;&gt;This is the end of a Database Results region.&lt;/font&gt;&lt;/td&gt;&lt;/tr&gt;&lt;TR&gt;&lt;TD ALIGN=LEFT VALIGN=MIDDLE COLSPAN=64&gt;&lt;NOBR&gt;&lt;INPUT TYPE=Button VALUE=&quot;  |&lt;  &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot;   &lt;  &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot;  &gt;   &quot;&gt;&lt;INPUT TYPE=Button VALUE=&quot;  &gt;|  &quot;&gt;  [1/5]&lt;/NOBR&gt;&lt;BR&gt;&lt;/td&gt;&lt;/tr&gt;" startspan --><!--#include file="_fpclass/fpdbrgn2.inc"-->
<!--webbot bot="DatabaseRegionEnd" endspan i-checksum="62730" --></tbody>
</table>

</body>

</html>
jvescio:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
No comment has been added to this question in more than 245 days, so it is now classified as abandoned.

I will leave the following recommendation for this question in the Cleanup topic area:
   Accept: CRagsdell http:#8083445

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

monosodiumg
EE Cleanup Volunteer