Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

ASP Fixed Header and Footer

Posted on 2010-08-12
2
Medium Priority
?
985 Views
Last Modified: 2013-11-26
First time asking a question on here and relatively new to ASP, VB and CSS but I can't seem to figure out or find an answer to this problem anywhere.

I have SQL data that I am pulling into a Data Table and need it to display with a repeater with a fixed header and footer with the items being scrollable.

I've found that using 3 separate tables is probably the only way I'm going to be able to do this but when I do that, the vertical columns will not line up consistently. I have included the header on the item table to specify the column widths there instead of in the repeater item template but that introduces the problem of having a slight header and the top of the item table.

Keep in mind that the data in the item table will constantly be updated and I hope to make the columns sortable eventually.

Thanks in advance for any ideas.
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="contentbody">
        <div class="header"><h1>All Activity Logs</h1></div>                
            <center>
        <div id="tablecontent">
            <table width="917" border="1" cellpadding="2" cellspacing="0" class="rowdl">
                        <tr>
                            <th width="160" height="35">Name</th>
                            <th id="ex_dt" width="60">Date</th>
                            <th id="ex_name" width="200">Activity</th>
                            <th id="int_id" width="100">Intensity</th>
                            <th id="ex_time" width="95">Time</th>
                            <th id="ex_mile" width="95">Mileage</th>
                            <th id="ex_pts_per" width="95">Pts Per</th>
                            <th id="ex_tot_pts" width="112">Total Pts</th>
                        </tr>
            </table> 
            <div id="scrolllist">
                <asp:Repeater ID="Repeater1" runat="server">
                    <HeaderTemplate>
                        <table width="900" border="1" cellpadding="2" cellspacing="0" class="rowdl">
                        <tr>
                            <th width="160" height="0"></td>
                            <th id="ex_dt" width="58"></td>
                            <th id="ex_name" width="199"></td>
                            <th id="int_id" width="100"></td>
                            <th id="ex_time" width="97"></td>
                            <th id="ex_mile" width="97"></td>
                            <th id="ex_pts_per" width="96"></td>
                            <th id="ex_tot_pts" width="95"></td>
                        </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td height="20" class="rowdl"><%#Container.DataItem("full_name")%>&nbsp;</td>
                            <td class="rowdr"><%#NullDate(Container.DataItem("ex_dt"))%></td>
                            <td class="rowdl">&nbsp;<%#NullString(Container.DataItem("ex_name"))%></td>
                            <td class="rowdl">&nbsp;<%#NullString(Container.DataItem("int_id"))%></td>
                            <td class="rowdr"><%#NullString(Container.DataItem("ex_time"))%>&nbsp;</td>
                            <td class="rowdr"><%#NullNumber(Container.DataItem("ex_mile"), "#,#0.00; (#,#0.00); #,#0.00", "0.0")%>&nbsp;</td>
                            <td class="rowdr"><%#NullNumber(Container.DataItem("ex_pts_per"), "#,#0.0; (#,#0.0); #,#0.0", "0.0")%>&nbsp;</td>
                            <td class="rowdr"><%#NullNumber(Container.DataItem("ex_tot_pts"), "#,#0.0; (#,#0.0); #,#0.0", "0.0")%>&nbsp;</td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                    </table>
                    </FooterTemplate>                    
                </asp:Repeater>
            </div>
            <table width="917" border="1" cellpadding="2" cellspacing="0" class="rowdl">
                <tr>
                    <td width="160" height="20" class="blankbg"></td>
                    <td class="blankbg" width="60"></td>
                    <td class="blankbg" width="200"></td>
                    <td class="blankbg" width="100"></td>
                    <td class="rowdr" width="95">AVG Time</td>
                    <td class="rowdr" width="95">Mileage</td>
                    <td class="rowdr" width="95">Pts Per</td>
                    <td class="rowdr" width="112">Total Points&nbsp;&nbsp;&nbsp;&nbsp;</td>
                </tr>
            </table>   
        </div>
            </center>
</div>
</asp:Content>

Open in new window

0
Comment
Question by:WCCrobert
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 23

Accepted Solution

by:
Jens Fiederer earned 750 total points
ID: 33422961
Your method depends to a degree on which browsers you are planning to support.

The method at http://www.imaputz.com/cssStuff/bigFourVersion.html

works with most of the newer ones.
0
 

Author Closing Comment

by:WCCrobert
ID: 33430640
Solution was not entirely specific to my problem but guided me to finding the solution.
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

636 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