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

scrollbars in tables 1

Status
Not open for further replies.

redbay

Technical User
Oct 13, 2003
145
GB
Is theer any way that i can put a scroll bar in a table as i do not want to use record set paging?
 
Insert a div, with the overflow attribute set, into the cell and put your content into that. As below

Code:
<div style="height: 150px; overflow: auto"> 
      <p>Blah Blah Blah Blah Blah Blah </p> 
      <p>Blah Blah Blah Blah Blah Blah </p> 
      <p>Blah Blah Blah Blah Blah Blah </p> 
      <p>Blah Blah Blah Blah Blah Blah </p> 
      <p>Blah Blah Blah Blah Blah Blah </p> 
      <p>Blah Blah Blah Blah Blah Blah </p> 
      <p>Blah Blah Blah Blah Blah Blah </p> 
      <p>Blah Blah Blah Blah Blah Blah </p> 
      <p>Blah Blah Blah Blah Blah Blah </p> 
      <p>Blah Blah Blah Blah Blah Blah </p> 
      <p>Blah Blah Blah Blah Blah Blah </p> 
      <p>Blah Blah Blah Blah Blah Blah </p> 
    </div>

Cheech



[Peace][Pipe]
 
Hi Cheech i've been away and just tried this but still cant get it to work, heres my code!

<body>
<h1>Summary - Welcome <%= Session("mm_username") %></h1>
<table width="950" border="1" cellpadding="0" cellspacing="0"><!--DWLayoutTable-->
<tr>
<div style="height: 150px; overflow: auto">
<td width="110"><p><strong>Complaint <br>
Date</strong></p></td>
<td width="145"><strong>Category</strong></td>
<td width="208"><strong>Description</strong></td>
<td width="166"><strong>Customer Name</strong></td>
<td width="116"><strong>Acknowledged</strong></td>
<td width="82"><p><strong>Status</strong></p></td>
<td width="111">&nbsp;</td>
</div>
</tr>

is this correct or should i have put it elsewhere?

Thanks
 
What are you trying to do? You want each row under the header to scroll or you want the whole page to scroll?

Cheech

[Peace][Pipe]
 
each row under the header. i've nearly done this except the header scrolls as well
 
Hi

am still having problems with this, have got the data working fine but the whole table scrolls (including the header) how do i get this to remain this is my code
<body>
<h1>Summary - Welcome <%= Session("mm_username") %></h1>
<div style="border:1px 000000 solid; width: 990px; height:410px; overflow:auto; ">
<table width="965" border="1" cellpadding="0" cellspacing="0"><!--DWLayoutTable-->
<tr>
<td width="95"><center>
<strong>Complaint Ref. No </strong>
</center></td>
<td width="105"><center><strong>Complaint Date</strong></center></td>
<td width="245"><center><strong>Category</strong></center></td>
<td width="208"><center><strong>Description</strong></center></td>
<td width="108"><center><strong>Status</strong></center></td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsSummary.EOF))
%>
<% If rowColor = "Yellow" Then %> <tr bgcolor="#FFFFCC">
<% rowColor = "White"
Else %>
<tr bgcolor="FFFFFF">
<%rowcolor = "Yellow"
End If %>
<td>
<div align="center">
<a href="probedit.asp?<%= Server.HTMLEncode(MM_keepNone) & MM_joinChar(MM_keepNone) & "ComplaintID=" & rsSummary.Fields.Item("ComplaintID").Value %>"><%=(rsSummary.Fields.Item("ComplaintID").Value)%></a></td>
<td><center><%=(rsSummary.Fields.Item("ComplaintDate").Value)%></center></td>
<td> <%=(rsSummary.Fields.Item("Category").Value)%> </td>
<td><%=(rsSummary.Fields.Item("ShortDesc").Value)%></td>
<td><center><% If (rsSummary.Fields.Item("Status").Value) = True Then %>
<font color="#FF0000"><strong>Closed</strong></font>
<% Else %>
<font color="#008000"><strong>Open</strong></font>
<% End If %></center></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsSummary.MoveNext()
Wend
%>
</table>
</div>
<p>&nbsp;</p>
<p><a href="probnew.asp">Add new complaint</a> | <a href="custadd.asp">Add new customer</a> | <a href="actnew.asp">Add new action</a></p>
<p><a href="customers.asp">More customer info</a> | </p>
<p>&nbsp;</p>
<p><a href="<%= MM_Logout %>">logout</a></p>
</body>
</html>
 
Paste this into a blank document and see if it will do what you want
Code:
<body>
<div id="Layer2" style="position:absolute; width:600px; height:389px; z-index:1; left: 11px; top: 42px; overflow: scroll;">
  <table width="100%"  border="1" cellspacing="0" cellpadding="0">
    <tr>
      <td width="33%">Item 1 </td>
      <td width="33%">Item 2 </td>
      <td width="34%">Item3</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
</div>
<div id="Layer1" style="position:absolute; width:600px; height:24px; z-index:1; left: 11px; top: 18px;">
  <table width="100%"  border="1" cellspacing="0" cellpadding="0">
    <tr>
      <td width="33%">Blah</td>
      <td width="33%">Blah</td>
      <td width="34%">Blah</td>
    </tr>
  </table>
</div>
</body>

Not a perfect solution but it may suffice

Cheech

[Peace][Pipe]
 
Absolutly fantastic!...exactly what i wanted.
Thanks Cheech - have another STAR
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top