Solved

Table with  "absolute" total lines at bottom

Posted on 2000-03-17
9
174 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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
 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Joomla 2.5 shopping cart 7 30
Mobile page Scrolling down when refreshing 4 63
Html fieldset fix its height and width 4 28
Html Table Looping (part 2) 5 27
Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

840 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