Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Repeat headings in table for printout

Status
Not open for further replies.

CFrockchelle

Programmer
Dec 17, 2002
11
US
I have a query that is displayed in a table. The table is very long. Is there anyway that the table headings can be repeated on everypage that is printed?
 
you can use the MOD function and the currentrow variable to do this.

<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0>
<tr>
<td>Heading One</TD>
<TD>Heading Two</TD>
</TR>
<CFOUTPUT QUERY=&quot;yourQuery&quot;>
<CFIF (yourQuery.CurrentRow MOD 2) EQ 0>
<tr>
<td>Heading One</TD>
<TD>Heading Two</TD>
</TR>
</CFIF>
<TR>
<TD>#Your Data#</TD>
<TD>#Your Data2#</TD>
</TR>
</CFOUTPUT>
</TABLE>

This will print the heading every two lines if memory serves. Change the 2 to a larger number to make your heading appear at greater intervals

Hope this helps!
 
Not that I know of. Your application can never know where the page break will occur, because that is decided by the browser when it formats the page for the printer. Some of the variables that would affect where the page break occurs are: actual (displayed) font size, border width, cellpadding, whether or not text is allowed to wrap in the cells, etc. Although you can specify most of those things, the browser is allowed to make its own decisions on how it will render the HTML that you send to it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top