473,399 Members | 3,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Adding scroll to dynamic table

vikas251074
198 100+
I have created dynamic tables whose length depends upon the number of records.
Can I use scrollbar in tables?

My code for creating dynamic table is as follows -
Expand|Select|Wrap|Line Numbers
  1. <%
  2. dim conn
  3. set conn = Server.CreateObject("ADODB.Connection")
  4. conn.open = "Provider=MSDAORA.1;dsn=ops;password=op;user id=Outpass;Data Source=Intradb;Persist Security Info=True"
  5. set rs = server.CreateObject("ADODB.Recordset")
  6. set rs = conn.execute("Select gp_no, per_name, dept from gps")
  7. %>
  8. <script type="text/javascript" >
  9. window.onload = function() { dynamicTableInit(document.getElementById('myTable')); } ;
  10. </script>
  11. <br>
  12. <br>
  13. <br>
  14. <table id="myTable" class="dynamicTable" align="center" border="1" height="400px">
  15.   <thead>
  16.     <tr><th>Gatepass No.</th><th>Name of Person</th><th>Department</th></tr>
  17.   </thead>
  18.   <tbody>
  19. <%  do while not rs.eof %>
  20.       <tr><td><%=rs("gp_no")%></td><td><%=rs("per_name")%></td><td><%=rs("dept")%></td></tr>
  21. <%    rs.movenext
  22.     loop %>
  23.   </tbody>
  24. </table>
Is line no. 8,9, & 10 really needed?

Thanks and regards,
Vikas
Jun 6 '08 #1
3 4277
gits
5,390 Expert Mod 4TB
hi ...

you cannot use a 'native' scrollbar in a table ... but you may use a div and set its overflow-css-property, or implement a custom scroller. or use a paging-mechanism with first 10 records, next etc.

to you other question: what does the function do? have a look at its code ... may be it adds some events for sorting the table or whatever. in case you! don't need it ... then its not needed ;) ... why do you have used it at the moment?

kind regards
Jun 6 '08 #2
vikas251074
198 100+
All this contents have been collected from net searching. I think this line may be usefull thats why I added these lines.

Now I got the solution of scrollbar by adding below line
[HTML]<div align="center" class="myDiv" style="width: 520px; height: 435px; padding:4px; border: 0px ; overflow:auto ">[/HTML]

Thanks and regards,
Vikas
Jun 6 '08 #3
gits
5,390 Expert Mod 4TB
glad to hear that ;) ... post back to the forum anytime you have more questions ...

kind regards
Jun 6 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: justdummy | last post by:
Hi, I am struggling with a problem for sometimes. I need to display a table in a html and if the height of the table goes beyond 200 px then a vertical scrollbar should alone appear without any...
2
by: Viorel | last post by:
Adding new row with default values. In order to insert programmatically a new row into a database table, without direct "INSERT INTO" SQL statement, I use the well-known DataTable.NewRow,...
4
by: Bas Groeneveld | last post by:
I am developing an ASP.NET application part of which consists of a data entry wizard defined by entries in a data table - ie the controls on each page of the wizard are determined by definitions in...
3
by: Tyler Carver | last post by:
I am trying to use some dynamic controls that are built and then added to tables. The problem that I am having is the timing of when I can populate the controls and have the state remain after a...
1
by: seanmayhew | last post by:
I have a form page that that while editing saves the data to an xml doc before submitting to db. On each page unload it saves the xmldoc as the user can add multiple items to the company like...
0
by: Luis Esteban Valencia | last post by:
Hello I wrote a program with code behind in C# to add row into table dynamically and the program worked very well in .Net Framework 1.1. When I run this program in .Net Framework 2.0 beta...
3
by: Ankit Aneja | last post by:
I have a strange situation and I have no idea how to solve this. Its a Recruitment Search Page,in the Admin Page, for every button click event the Admin Person has to create a checkbox on the users...
69
by: RC | last post by:
I know how to do this in JavaScript by window.open("newFile.html", "newTarget", "scrollbars=no,resizable=0,width=200,height=200"); The browser will open a new window size 200x200, not allow...
0
by: EricLondaits | last post by:
Hi, I have an ASP.NET page with a ListBox that is data bound to a table with a single field (it holds a list of valid IDs). The page also has a textBox into which you can add new valid IDs, one...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.