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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to obtain a different table title on a continuation page ?

Status
Not open for further replies.

leifoet

Technical User
Jan 31, 2016
203
BE
The <th> tag defines a header cell in an html table.
Every time a continuation page of the table is printed, the same content of the header cell <th> is printed at the top of the page.
Question: how can the text of this header cell from the 2nd printed page differ from the 1st page?
The following attempt with IIF does not work.
Thanks for tips.

Code:
<body>
<table border="1">
<thead>
<tr>
<th width="25" align="right"><b><i>Nr.</i></b></td>
<th width="100" align="left"><b><i>

<%Response.Write IIf(PageBreak=true, "newName", "Name")%></b></td>

<th width="70" align="left"><b><i>Date</i></b></td>
</tr>
</thead>
 
How are you generating the code or is this just straight ASP with no back engine generating the code
 
My not working test code.
Thanks for corrections.

Code:
<% @LANGUAGE="VBSCRIPT" %>
<%
'TEST
Function IIf(i,j,k)    
If i Then IIf = j Else IIf = k  
End Function

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<style>
table, td, th {    
    border: 1px solid #ddd;
}

table {
    border-collapse: collapse;
}

th, td {
    padding: 3px;
}
</style>

</head>

<body id="page">
<p style="margin-top: 0; margin-bottom: 0"><font face="Verdana" size="2" color="blue"><b>
TEST</b></p>

<table border="1">
<thead>
	<tr>
 		<th width="25" align="right"><b><i>Nr.</i></font></b></td>
      		<th width="100" align="left"><b><i>
     
		<%Response.Write IIf(PageBreakafter=true, "newName", "Name")%></b></td>

		<th width="70" align="left"><b><i>Date</i></b></td>		
    	</tr>

</thead>


<%
Dim Conn, rs, sql
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("DBXYZ.mdb")
   
Set rs = Server.CreateObject("ADODB.Recordset")
sql = "SELECT * FROM TEST ORDER BY SfId DESC"
rs.Open sql, Conn

Do While Not rs.EOF
%>


	<tr>
      		<td width="25" align="right"><%=rs("SfId")%>&nbsp;</td>
     		<td width="100">&nbsp;<%=rs("Name")%></td>
		<td ...  </td> 
	</tr>

<%rs.moveNext
Loop%>

</table>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top