473,786 Members | 2,849 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Adding scroll to dynamic table

vikas251074
198 New Member
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 4297
gits
5,390 Recognized Expert Moderator Expert
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 New Member
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 Recognized Expert Moderator Expert
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
134390
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 horizontal scroll bar. If the height of the table is less than 200 px then no scroll bars should appear. Here is the html below. I tried to wrap the table around a <div> tag but its doesn't work out as the scroll bar appear close to the scroll bar...
2
5664
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, DataTable.Rows.Add and DataAdapter.Update member functions. Before adding the new row object to the Rows collection, all of the row's fields that do not accept NULL must be assigned, otherwise an exception is thrown. However, I do not want to assign...
4
2500
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 the table. I know that I can dynamically add controls (eg a textbox) to the page controls collection of a web form in a server event which will then be rendered onto the form, as in the following snippet: System.Web.UI.WebControls.TextBox...
3
1811
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 postback. The main question would be this: Why does this work for maintaining state after a postback for dynamic controls: myText = new Label(); myText.ID = "myText";
1
2034
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 product types etc. So for instance Im adding a fruit company while adding a fruit company I allow the user to add types of fruit they carry and display it dynamically using an <asp:table> with image
0
2406
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 version, the program is not working as in version 1.1. So what is the problem? Microsoft declared that the version 2.0 is fully backward support, but it is not. Is that the problem with 2.0 version? I find out the problem in version 2.0. After...
3
2346
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 page. So whenever the Admin person comes to know about the new category in the market he will be adding as different Sub-Categories for example ABAP, BDC etc..etc.. on every click event as Checkboxes. And these controls(checkboxes) should remain...
69
13490
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 resize and no auto horizontal, vertical scrolling bars. I am wonder can I do the similar inside a HTML file like
0
1851
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 per line (this is in order to make the process of adding new IDs easy, since it's only done at time of configuration). I have no problem with retrieving the contents of the textBox, splitting it into a string array, validating the individual...
0
9647
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9961
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5397
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4066
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3669
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.