首页 > 解决方案 > 表格标题位置粘滞在模板 Web 组件中不起作用?

问题描述

我有一个表格 Web 组件,其中的标题需要粘性,但是当我尝试应用 css 时它不起作用。在此处输入图像描述

scss

.table-section{
    height: calc(100vh - 252px);
    overflow: auto;
    overflow-x: hidden;
    width: 100%;
}

ezee-table {
    table{
        position: relative;
    }
}

th{
    position: sticky;
    position: -webkit-sticky;
    top: 0; /* required */
    z-index: 1;
}

标签: cssweb-componentshadow-dom

解决方案


推荐阅读