How do I freeze the first and last columns of an html table in a scrollable div?

前端 未结 7 1467
天涯浪人
天涯浪人 2020-12-28 08:57

I have a table which has a header row, but also a header column and a total column with several columns in between.

Something like this:

Name    Scor         


        
7条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-28 09:18

    Did u mean horizontal scrolling??

    If you want to achieve horizontal scrolling then you can use 3 containers.

    1. For the first column ( Name )
    2. For the columns that you want to scroll. Set the overflow-x style of this container to auto
    3. For the last column ( Total )

提交回复
热议问题