Solved

Table with  "absolute" total lines at bottom

Posted on 2000-03-17
9
170 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this tutorial viewers will learn how add a full-size background image to a webpage using CSS3. Create a new HTML document with an internal stylesheet.: In CSS, define the html element to have a background image. Use a high resolution image.: In t…

707 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

17 Experts available now in Live!

Get 1:1 Help Now