Fixed header and scrollable body

后端 未结 6 658
面向向阳花
面向向阳花 2020-12-14 11:26

I have like 15 columns in the table. I want to scroll both horizontal and vertical and header should be fixed when I scroll vertical. I have tried various examples but no

6条回答
  •  悲哀的现实
    2020-12-14 12:13

    It's easily acheived with css. It all comes down to the following:

    table {
        overflow-x:scroll;
    }
    
    tbody {
        max-height: /*your desired max height*/
        overflow-y:scroll;
        display:block;
    }
    

    Updated for IE9 JSFiddle example

提交回复
热议问题