add scrollbar to table
Hi, the following page is opened within an <iframe> can anybody see how it is possible to add a scrollbar ideally to just the table or to the entire window, please note <style="overflow:scroll"> isn't working within any of the tabs, i think it is because the table is populated after the page is loaded and the scrollbar function is established during the onload event?????
heres the code, thank you....
<%
' Declare variables
Dim strURL ' The URL of this page so the form will work no matter what this file is named.
Dim cnnSearch ' ADO connection
Dim rstSearch ' ADO recordset
Dim strDBPath ' path to our Access database (*.mdb) file
Dim strSQL ' The SQL Query we build on the fly
Dim strSearch ' The text being looked for
' Retreive the URL of this page from Server Variables
strURL = Request.ServerVariables("URL")
' Retreive the term being searched for. I'm doing it on
' the QS since that allows people to bookmark results.
' You could just as easily have used the form collection.
strSearch = Request.QueryString("search")
'strSearch = Replace(strSearch, "'", "''")
%>
<h2>Internal Contact Search</h2>
<form action="<%= strURL %>" method="get">
<input name="search" value="<%= strSearch %>" />
<input type="submit" value="Search" />
</form>
<%
If strSearch <> "" Then
' MapPath of virtual database file path to a physical path.
' If you want you could hard code a physical path here.
strDBPath = Server.MapPath("Contacts.mdb")
' Create an ADO Connection to connect to the sample database using OLE DB.
cnnSearch = Server.CreateObject("ADODB.Connection")
' This line is for the Access sample database:
cnnSearch.Open("Provider=Microsoft.Jet.OLEDB.4.0;D ata Source=" & strDBPath & ";")
' Build our query based on the input.
strSQL = "SELECT * " _
& "FROM [tblEmployee] " _
& "WHERE Name LIKE '%" & Replace(strSearch, "'", "''") & "%' " _
& "ORDER BY Name;"
' Execute our query using the connection object. It automatically
' creates and returns a recordset which we store in our variable.
rstSearch = cnnSearch.Execute(strSQL)
' Display a table of the data in the recordset. We loop through the
' recordset displaying the fields from the table and using MoveNext
' to increment to the next record.
%>
<table border="0" cellspacing="2" Width="845px">
<tr style="background-color:#5D7B9D; color:White">
<th style="height: 16px">Name</th>
<th style="height: 16px">Department</th>
<th style="height: 16px">Extension</th>
<th style="height: 16px">E-mail</th>
</tr>
<%
Do While Not rstSearch.EOF
%>
<tr style="background-color:#F7F6F3; color:#284775;">
<td><%= rstSearch.Fields("Name").Value %> </td>
<td><%=rstSearch.Fields("Department").Value%></td>
<td><%=rstSearch.Fields("Extension").Value%></td>
<td><%=rstSearch.Fields("E-mail").Value%></td>
</tr>
<%
rstSearch.MoveNext
Loop
%>
</table>
<%
' Close our recordset and connection and dispose of the objects
rstSearch.Close
rstSearch = Nothing
cnnSearch.Close
cnnSearch = Nothing
End If
%>
</body>
|