Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 182
  • Last Modified:

Table with "absolute" total lines at bottom

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
dciucci
Asked:
dciucci
  • 3
  • 2
  • 2
  • +2
1 Solution
 
dciucciAuthor Commented:
FYI-The RCWorkListTable in the srs101 function is a typo. It should read WorkListTable.
0
 
yolishCommented:
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
 
dciucciAuthor Commented:
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
nettromCommented:
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
 
TTomCommented:
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
 
radziCommented:
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
 
nettromCommented:
the IFRAME element, even though found in HTML 4.0, is not supported by Netscape nor Opera.
0
 
dciucciAuthor Commented:
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
 
TTomCommented:
Exactly!

Tom
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now