Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/hip-parents-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'my-evidence-project': patch
---

Added a sticky header to data tables
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
}
</script>

<thead>
<thead class="sticky top-0 z-10">
{#if orderedColumns.length > 0}
{@const columnsWithGroupSpan = orderedColumns.map((column, index, array) => {
// Determine if this column starts a new group or continues an existing one
Expand Down Expand Up @@ -78,7 +78,7 @@
{/if}
{/if}

<tr class="border-b border-base-content-muted/60">
<tr>
{#if rowNumbers}
<th
role="columnheader"
Expand Down Expand Up @@ -147,6 +147,9 @@
</thead>

<style>
thead {
box-shadow: 0 1px 0 0 rgba(138, 138, 138, 0.6);
}
th {
white-space: nowrap;
overflow: hidden;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
export let wrapTitles = false;
$: wrapTitles = toBoolean(wrapTitles);

export let headerColor = undefined;
export let headerColor = 'base-100';
$: headerColorStore = resolveColor(headerColor);

export let headerFontColor = undefined;
Expand Down Expand Up @@ -571,7 +571,7 @@
{/if}

<div class="scrollbox pretty-scrollbar" style:background-color={$backgroundColorStore}>
<table>
<table class="relative">
<TableHeader
{rowNumbers}
headerColor={$headerColorStore}
Expand Down Expand Up @@ -802,6 +802,7 @@
width: 100%;
overflow-x: auto;
scrollbar-width: thin;
max-height: 70vh;
}

table {
Expand Down
Loading