我有一个由 div 组成的表格,我有一个标题和正文,在正文中我正在对组件进行迭代。它工作正常,但我想让标题在我滚动时不向下滚动我尝试了许多不同的选项,但它们破坏了我放错位置的表格单元格我尝试过的一些选项是
这是我的桌子
<div class="divTable">
<div class="divTableHeading">
<div class="divTableRow">
<div class="divTableHead">Email</div>
<div class="divTableHead">Date</div>
<div class="divTableHead">Id</div>
</div>
</div>
<div class="divTableBody">
<div class="divTableRow">
<aura:iteration items="{!v.workList}" var="work" indexVar="index">
<div class="divTableRow">
<c:AdminHours userEmail="{!v.userEmail}" changedDate="{!v.changedDate}" a recordId="{!v.recordId}" />
</div>
</aura:iteration>
</div>
</div>
</div>
这是我的CSS
.THIS .divTable{
display: table;
width: 100%;
}
.THIS .divTableRow {
display: table-row;
}
.THIS .divTableHeading {
display: table-header-group;
}
.THIS .divTableCell,.THIS .divTableHead {
border: 1px solid #dddddd;
display: table-cell;
padding: 3px 10px;
}
.THIS .divTableHeading {
display: table-header-group;
font-weight: bold;
background-color: #f3f2f2;
}
.THIS .divTableBody {
display: table-row-group;
}