[英]Always display 1st row and 1st column of a table on screen
感謝您在本網站上為我提供的所有幫助,朋友們。 我無法做一件非常困難的事情,我懷疑這對我來說是否可能。
任務
使asp:Table的第一行和第一列始終顯示在屏幕上,而該表的其余部分是可滾動的。 一定要。
環境
Asp.net,C#。 沒有Java腳本。 沒有jQuery。 但是我已經准備好使用所有可以幫助您的東西。
ASPX表聲明
該表在aspx頁中靜態聲明。 還有另一張桌子。 它們被放入asp:MultiView中的不同asp:Views中。 從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>
建議
如果使用當前的方法無法解決問題,則可以學習其他方法,包括JavaScript。
部分解決。 我將標題放到主表頂部的單獨表中。 主表位於可滾動的div中,而標頭表位於頂部的div中,並且不會滾動。 這允許垂直滾動,標題行始終在頂部。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.