简体   繁体   English

始终在屏幕上显示表格的第一行和第一列

[英]Always display 1st row and 1st column of a table on screen

I'm thankful for all help that you provided me with on this site, friends. 感谢您在本网站上为我提供的所有帮助,朋友们。 There is one quite difficult thing I can't do, and I doubt it is possible for me. 我无法做一件非常困难的事情,我怀疑这对我来说是否可能。

THE TASK 任务

Make first row and first column of an asp:Table constantly displayed on screen while the rest of the table is scrollable. 使asp:Table的第一行和第一列始终显示在屏幕上,而该表的其余部分是可滚动的。 By all means. 一定要。

THE ENVIRONMENT 环境

Asp.net, C#. Asp.net,C#。 No java script. 没有Java脚本。 No jQuery. 没有jQuery。 But I'm ready to use everything that can help. 但是我已经准备好使用所有可以帮助您的东西。

ASPX TABLE DECLARATION ASPX表声明

The table is statically declared in aspx page. 该表在aspx页中静态声明。 There is also another table. 还有另一张桌子。 They are put into different asp:Views in asp:MultiView . 它们被放入asp:MultiView中的不同asp:Views中。 Data is retrieved from SQL Server database in code-behind, cells and rows are created in code-behind. 从SQL Server数据库中的代码隐藏中检索数据,在代码隐藏中创建单元格和行。

    <asp:Panel ID="pnlPanel1" runat="server" Visible="False" Enabled="False" Style="position: absolute; top: 57px; left: 0px; right: 0px; bottom: 0px; overflow: visible;">
        <asp:MultiView ID="mvMultiView1" runat="server" ActiveViewIndex="0">
            <asp:View ID="vView1" runat="server">
                <div style="position: absolute; top: 22px; left: 90px; right: 0px; bottom: 0px; border: 0px #BAC7DB solid; border-right: none; background-color: #FFF; z-index: 98;">
                    <asp:Table ID="tblTable1" runat="server" CssClass="class_Schedule" GridLines="Both"/>
                    </asp:table>                        
                </div>
            </asp:View>
            <asp:View ID="vView2" runat="server">
                <div style="position: absolute; top: 22px; left: 90px; right: 0px; bottom: 0px; border: 0px #BAC7DB solid; border-right: none; background-color: #FFF; z-index: 98;">
                    <asp:Table ID="tblTable2" runat="server" CssClass="class_Schedule" GridLines="Both"/>
                    </asp:table>                        
                </div>
            </asp:View>
        </asp:MultiView>
    </asp:Panel>

SUGGESTIONS 建议

If the problem can't be resolved with my current realization, I'm ready to learn other ways, including JavaScript. 如果使用当前的方法无法解决问题,则可以学习其他方法,包括JavaScript。

Partially resolved. 部分解决。 I put the header to a separate table that is on the top of main table. 我将标题放到主表顶部的单独表中。 Main table is in a scrollable div, while the header table is in the top div and don't scroll. 主表位于可滚动的div中,而标头表位于顶部的div中,并且不会滚动。 This allows vertical scrolling with the header row always on top. 这允许垂直滚动,标题行始终在顶部。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM