Solved

Table with  "absolute" total lines at bottom

Posted on 2000-03-17
9
171 Views
Last Modified: 2011-09-20
First of all, I'm very new to Web Development so please excuse my terminology.
I'm trying to create a page that will read info from a database into a table. At the bottom of the page, I want a total amount line that is always visible no matter the length of the table above it. So......  I need scroll bars on the table. I have the <div></div> and using a style sheet, etc. I'm not sure which way to go with this.  I'm also familiar with style sheets and have tried using them.
What I have SO FAR is this :
      <center>
      <table bgcolor="linen" name="testtable" id="testtable" height="20%" width="95%" cellpadding="0" cellspacing="0" border="1" rules="cols" style="BACKGROUND-IMAGE: none;">
      <tr>
            <table bgcolor="linen" name="testtable" id="testtable" height="20%" width="95%" cellpadding="0" cellspacing="0" border="1" rules="cols" style="BACKGROUND-IMAGE: none;">
            <div class=DivTable id=WorkListTable>
<%
      set oCN = server.CreateObject("ADODB.Connection")
      set oRS = server.CreateObject("ADODB.Recordset")
      oCN.Open "Driver={SQL Server};server=xxx;database=xxx;uid=xx;pwd=xx"
      set ors = oCN.Execute("Select * from tblclaims")
%>  
            <%do until ors.EOF %>
            <%trid="tr" & cstr(oRS("ClaimID"))%>
                  <tr name="<%=trid%>" id="<%=trid%>">
                        <td><A class=RevText href="javascript:highlight(<%=trid%>,3)" id="a<%=trid%>1" name="a<% =trid%>1" style="TEXT-DECORATION: none" title="Click to Select" ><font size=2><%=oRS("ClaimDate")%></A></TD>
                        <td><A class=RevText href="javascript:highlight(<%=trid%>,3)" id="a<%=trid%>2" name="a<% =trid%>2" style="TEXT-DECORATION: none" title="Click to Select" ><font size=2><%=oRS("InvoiceNumber")%></A></TD>
                        <td><A class=RevText href="javascript:highlight(<%=trid%>,3)" id="a<%=trid%>3" name="a<% =trid%>3" style="TEXT-DECORATION: none" title="Click to Select" ><font size=2><%=trim(oRS("lastname")) & ", " & trim(oRS("firstname")) & trim(ors("middleinitial"))%></A></TD>
                  </TR>

            <%ors.movenext
            loop
            Set ors = Nothing
            Set ocn = Nothing
            %>
            </div>
            </table>
      </tr>
      </TABLE>
      <!-- The following table is for the total line-->
      <TABLE WIDTH=95% BGCOLOR=Linen ALIGN=center BORDER=0 CELLSPACING=1 CELLPADDING=5>
      <div id=Footer>
      <TR>
            <TD align="right"><font class=RevText size=3><b>Total Rejected Amount:</b></font></TD>
            <TD><INPUT type="text" id=text1 name=text1></TD>
            <TD align="right"><font class=RevText size=3><b>Rejections Outstanding</b></font></TD>
            <TD><INPUT type="text" id=text1 name=text1></TD>
      </TR>
      </div>
      </TABLE>
      </CENTER>
      <script for=window event=onscroll LANGUAGE="JScript">
      srs101();
      </script>
      <script LANGUAGE="JavaScript">
      
      function srs101() {
            with (document.body){
//                  RCWorkListTable.style.top=scrollTop+100;
            }
      }
      
            
      </script>
0
Comment
Question by:dciucci
  • 3
  • 2
  • 2
  • +2
9 Comments
 

Author Comment

by:dciucci
ID: 2629075
FYI-The RCWorkListTable in the srs101 function is a typo. It should read WorkListTable.
0
 

Expert Comment

by:yolish
ID: 2629093
The way you have it will work with having the totals at the bottom of the table no matter what... To get the totals, you can use a count in you sql string, or create a counter in your loop so that everytime it loops to increment the counter + 1

<%
Counter = Counter + 1
ors.movenext
loop
Set ors = Nothing
Set ocn = Nothing
%>

Then in your totals table, just call the counter variable...

<% =Counter %>

Hope this helps
0
 

Author Comment

by:dciucci
ID: 2629138
Yes that helps ( I haven't even gotten to putting in a counter and the "total dollar amount" variable. In my testing, you don't even see the total line until you scroll down to the end of the table....   For example, you only can see 10 of the 30 lines in the table ... you don't see the total line at all until you scroll down past all 30 lines...... I want the total line to be visible all of the time. (absolute).  I will be putting this page in a frame in another web page.......
0
 
LVL 7

Expert Comment

by:nettrom
ID: 2630906
dciucci: if you're really up for a challenge, try using the HTML 4.0 extended table model, and create a set footer for your table that stays put.  only problem is that you'll have to download Mozilla to view it properly. :-)

the table spec's at http://www.w3.org/TR/html4/struct/tables.html and Mozilla can be downloaded from http://www.mozilla.org/
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 9

Expert Comment

by:TTom
ID: 2631255
Although it may seem a little far afield, it sounds like what you want/need to do amounts to making the total row into some sort of "watermark", which retains its position on the page.

Check out www.webreference.com/dhtml and www.brainjar.com.  Webreference has code for a watermark and brainjar has a navigation bar which moves down the page as you scroll.

I don't know if this code will be compatible with what you need, but it might give you enough to work it out.

Tom
0
 

Accepted Solution

by:
radzi earned 50 total points
ID: 2635000
Why not using simple Frames? It will give you a better compatibility and a simpler code. If compatibility doesn't count - try iFrame, this will sure give you the answer.
0
 
LVL 7

Expert Comment

by:nettrom
ID: 2635380
the IFRAME element, even though found in HTML 4.0, is not supported by Netscape nor Opera.
0
 

Author Comment

by:dciucci
ID: 2637741
I had thought of using frames at the beginning but wasn't sure how to take the total from the frame with the table and get it to the "total" text area in the next frame........  I guess that will be the subject of my next question. I do need to be concerned with browser compatibility and also our clients will need to view these pages so I was concerned about them downloading Mozilla (or whatever it was called.) I assume I'm doing the point thing correctly by awarding the points to the person whose suggestion I took???
0
 
LVL 9

Expert Comment

by:TTom
ID: 2637753
Exactly!

Tom
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Bootstrap 3 icons 3 39
iframe detection of parent window scale 20 59
AngularJS Page Control Understanding 5 38
html input type 3 21
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now