Forum Moderators: open
<%
while(rs.next()) //show table records
%>
<tr >
<td height="30" bgcolor="pink"><font size="1" face="arial">
<%=rs.getString(1)%>
</font></td>
<td height="30" bgcolor="pink"><font size="1" face="arial">
<%=rs.getString(2)%>
</font></td>
<td height="30" bgcolor="pink"><font size="1" face="arial">
<%=rs.getString(3)%>
</font></td>
<td height="30" bgcolor="pink"><font size="1" face="arial">
<%=rs.getString(4)%>
</font></td>
<td height="30" bgcolor="pink"><font size="1" face="arial">
<%=rs.getString(5)%>
</font></td>
<td height="30" bgcolor="pink"><font size="1" face="arial">
<%=rs.getString(6)%>
</font></td>
<td height="30" bgcolor="pink"><font size="1" face="arial">
<%=rs.getString(7)%>
</font></td>
<td height="30" bgcolor="pink"><font size="1" face="arial">
<%=rs.getString(8)%>
</font></td>
</tr>
<tbody> </tbody>
</table>
<form>
<center> <input type="button" value="Print this page" onClick="window.print()"> </center>
</form>
from link above at w3c.org:Table rows may be grouped into a table head, table foot, and one or more table body sections, using the THEAD, TFOOT and TBODY elements, respectively. This division enables user agents to support scrolling of table bodies independently of the table head and foot. When long tables are printed, the table head and foot information may be repeated on each page that contains table data
Unfortunately I don't think any browser supports this yet!
Since you can't tell anything from a client's print setup I think you're facing mission impossible here. You're only hope is to dynamically generate something where you have print control (like a pdf).
Unfortunately I don't think any browser supports this yet!
solution with pdf?
err... I wish it were that easy. I work on intranet applications for companies and sometimes they have to absolutely have reports that work like thick client applications - for this we use third party reporting tools like Crystal Reports. This is generally very hard core coding though (though crystal's a little easier).