Skip to content

Commit

Permalink
Make table header sticky using css
Browse files Browse the repository at this point in the history
  • Loading branch information
KenyShah24 committed Dec 2, 2024
1 parent 78f26cd commit fb2c872
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion src/assets/scss/_recordset-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
@use 'variables';

.recordset-table {
overflow-y: hidden;
// overflow-y: hidden;
max-height: 500px;
}

.chaise-table.table {
Expand Down Expand Up @@ -44,6 +45,9 @@
.table-heading {
background-color: map.get(variables.$color-map, 'table-header-background');
color: map.get(variables.$color-map, 'black');
position: sticky;
top:0;
z-index: 2;

.actions-header {
width: 100px;
Expand Down
2 changes: 1 addition & 1 deletion src/components/recordset/recordset-table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ const RecordsetTable = ({
return (
<th
key={index}
className={'c_' + makeSafeIdAttr(col.column.name) + (canSort ? ' clickable' : '')}
className={'c_' + makeSafeIdAttr(col.column.name) + (canSort ? ' clickable' : '') +' sticky_header'}
{...(canSort && { onClick: () => changeSort(col) })}
>
{col.column.comment ?
Expand Down

0 comments on commit fb2c872

Please sign in to comment.