Frozen table header inside scrollable div

前端 未结 11 2129
Happy的楠姐
Happy的楠姐 2020-11-30 04:15

I\'ve three divs. Header, central and footer. There is a table in central div (gridview) which is almost always longer than outer div. So I\'ve made this div scrollable vert

11条回答
  •  情歌与酒
    2020-11-30 04:51

    What you actually want to be doing is making the of the data table scrollable, so the and will remain naturally fixed.

    Whilst this is trivial for FF et al:

    tbody
    {
        height: 100px; /* or whatever */
        overflow: auto;
        overflow-y: auto;
        overflow-x: hidden;
    }
    

    IE has severe and complex issues with tbody in general. It can be solved with expressions but it's non-trivial, and specific to the design.

提交回复
热议问题