簡體   English   中英

在可通過 overflow-x 滾動的 html css 角度表中,有沒有辦法修復最右邊的列?

[英]In a html css angular table that is scrollable through overflow-x, is there a way to fix the right-most column?

在可通過 overflow-x 滾動的 html css 角度表中,有沒有辦法修復最右邊的列,以便當我從左向右滾動時,該列保留在那里?

我嘗試了粘性屬性,並在彼此旁邊創建了兩個表(這沒有成功完成任務。我在想我應該將兩個表疊加在彼此之上,但我不確定我應該如何去做。

position: sticky似乎在 chrome 和 firefox 上運行良好:

 div { width: 100%; overflow: hidden; overflow-x: scroll; } table, th, td { border: 1px solid black; background-color: white; } table { width: 1000px; }.sticky-col { width: 40px; position: sticky; right: 0; }
 <div> <table> <tr><th>1</th><th>2</th><th class="sticky-col">3</th></tr> <tr><td>1,1</td><td>1,2</td><td class="sticky-col">1,3</td></tr> <tr><td>2,1</td><td>2,2</td><td class="sticky-col">2,3</td></tr> <tr><td>3,1</td><td>3,2</td><td class="sticky-col">3,3</td></tr> </table> </div>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM