How to make table row fixed at the top

前端 未结 5 605
梦谈多话
梦谈多话 2020-12-17 16:24

I have a table without th elements, Only td elements are there. Is there any way to make My first row fixed(label). The table is like this

5条回答
  •  难免孤独
    2020-12-17 16:36

    I've been searching for an answer for this problem for a while and finally I've found something that works very nice.

    The secret is in this piece of code that makes the scrolling possible in the table

    thead, tbody, tr, td, th { display: block; }
    

    But you can find a full example here http://jsfiddle.net/T9Bhm/7/.

    Hope it helps! :)

提交回复
热议问题