Frozen table header inside scrollable div

前端 未结 11 2139
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 05:02

    This solution works using CSS in Firefox and the other Gecko browsers, and CSS expressions in IE.

    http://home.tampabay.rr.com/bmerkey/examples/nonscroll-table-header.html

    The header and footer do not stay fixed in Opera or Safari/Chrome, but the whole table is scrollable so it is usable. Note that the columns are given percentage widths in the author's example, but they can be removed.

    If you want to experiment with Opera/Safari/Chrome support, look at giving the tbody display:block and go from there.

提交回复
热议问题