I am currently working on making the header visible while scrolling down the page.
I managed to achieve this by using display:block; in the CSS for the body element.
However, I am facing an issue where the columns of the header are not aligned with the columns in the body section.
I have tried several solutions but haven't been able to correct this misalignment.
My current setup involves using Bootstrap classes (e.g., col-xs-12 col-lg-2 col-xl-2 for username, ...) for better layout.
Additionally, it would be great if the table could adjust to the scrollbar dynamically.
<div class="container">
<t:grid
source="users"
class="table list-user thead-inverse table-hover"
inplace="true"
cellDecorators="cellDecorator"
rowDecorators="rowDecorator"
t:mixins="GridDecorator"
model="modelUserList"
row="user"
pagerPosition="both"
renderTableIfEmpty="true">
<p:inventoryCell>
${inventoryString}
</p:inventoryCell>
<p:actionsCell>
<t:actionlink
t:id="editUser"
context="user.id"
t:zone="userEditZone">
<i class="icon-md ion-android-settings" />
</t:actionlink>
<t:if test="notSelf">
<t:actionlink
t:id="deleteUser"
t:mixins="confirm"
t:message="Are you sure you want to delete ${user.fullname}?" page="index"
context="user.id">
<i class="icon-md ion-trash-b" />
</t:actionlink>
</t:if>
</p:actionsCell>
<p:lastloginCell>${lastlogin}</p:lastloginCell>
</t:grid>
</div>
#userlist table .row
{
margin-right: 0rem;
margin-left: 0rem;
table-layout:fixed;
text-overflow: ellipsis;
/* flex-wrap:unset;*/
}
#userlist thead {
display: inline;
}
#userlist tbody {
display: block;
height: 44.25rem;
overflow: auto;
}
#userlist table .row td {
word-break: break-all;
border: none;
}
#userlist table .row th, #bestandlist table .row th {
border: none;
text-overflow: ellipsis;
}
<div data-container-type="zone">
<table class="table list-user thead-inverse table-hover">
<thead>
<tr class="row hidden-md-down" data-inplace-grid-links="true">
<th class="col-xs-12 col-lg-2 col-xl-2" data-grid-column="first" data-grid-column-sort="sortable" data-grid-property="username"></th>
<th class="col-xs-12 col-lg-2 col-xl-2" data-grid-column-sort="sortable" data-grid-property="email"></th>
<th class="col-xs-12 col-lg-2 col-xl-2" data-grid-column-sort="sortable" data-grid-property="userFunction"></th>
<th class="col-xs-12 col-lg-2 col-xl-1" data-grid-column-sort="sortable" data-grid-property="lastLogin"></th>
<th class="col-xs-12 col-lg-1 col-xl-1" data-grid-column-sort="sortable" data-grid-property=""></th>
<th class="col-xs-12 col-lg-1 col-xl-1" data-grid-column-sort="sortable" data-grid-property=""></th>
<th class="col-xs-12 col-lg-1 col-xl-1" data-grid-column-sort="sortable" data-grid-property=""></th>
<th class="col-xs-12 col-lg-1 col-xl-1" data-grid-column-sort="sortable" data-grid-property=""></th>
<th class="col-xs-12 col-lg-1 col-xl-1" data-grid-column-sort="sortable" data-grid-property=""></th>
<th class="col-xs-12 col-lg-1 col-xl-1" data-grid-column-sort="sortable" data-grid-property=""></th>
<th class="col-xs-12 col-lg-1 col-xl-1" data-grid-column-sort="sortable" data-grid-property=""></th>
<th class="col-xs-12 col-lg-1 col-xl-1" data-grid-column="last" data-grid-property="actions">Actions</th>
</tr>
</thead>
<tbody>
<tr class="row" data-grid-row="first">
<td class="col-xs-12 col-lg-2 col-xl-2" data-grid-property="username"></td>
<td class="col-xs-12 col-lg-2 col-xl-2" data-grid-property="email"></td>
<td class="col-xs-12 col-lg-2 col-xl-2" data-grid-property="userFunction"></td>
<td class="col-xs-12 col-lg-2 col-xl-1" data-grid-property="lastLogin"> </td>
<td class="col-xs-12 col-lg-1 col-xl-1" data-grid-property=""></td>
<td class="col-xs-12 col-lg-1 col-xl-1" data-grid-property=""></td>
<td class="col-xs-12 col-lg-1 col-xl-1" data-grid-property=""></td>
<td class="col-xs-12 col-lg-1 col-xl-1" data-grid-property=""></td>
<td class="col-xs-12 col-lg-1 col-xl-1" data-grid-property=""></td>
<td class="col-xs-12 col-lg-1 col-xl-1" data-grid-property=""></td>
<td class="col-xs-12 col-lg-1 col-xl-1" data-grid-property=""></td>
<td class="col-xs-12 col-lg-1 col-xl-1" data-grid-property="actions"></td>
</tr>
</<tbody>
</table>
</div>