By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,626 Members | 1,653 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,626 IT Pros & Developers. It's quick & easy.

Adding scroll to dynamic table

vikas251074
100+
P: 198
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
Share this Question
Share on Google+
3 Replies


gits
Expert Mod 5K+
P: 5,390
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
100+
P: 198
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
Expert Mod 5K+
P: 5,390
glad to hear that ;) ... post back to the forum anytime you have more questions ...

kind regards
Jun 6 '08 #4

Post your reply

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