How to make Data Table header sticky? #1573
Unanswered
CarlosGTrejo
asked this question in
Help
Replies: 1 comment
-
|
For what it is worth, this is what worked for me for a scrolling table body with a stick header: <Table.Root>
<ScrollArea class="h-100">
<Table.Header class="sticky top-0 bg-card">
<Table.Row>
<Table.Head>Starred</Table.Head>
<Table.Head>Order</Table.Head>
<Table.Head class="w-full">Name</Table.Head>
<Table.Head>Size</Table.Head>
<Table.Head class="min-w-40">Last modified</Table.Head>
<Table.Head>Actions</Table.Head>
</Table.Row>
</Table.Header>
<Table.Body>
{#if book !== undefined}
{#each book.ruleSets as ruleSet (ruleSet.file.name)}
<RuleSetRow bind:draft={book} {ruleSet}></RuleSetRow>
{/each}
{/if}
</Table.Body>
</ScrollArea>
</Table.Root>Note that |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I've tried adding the classes
sticky top-0toTable.Headerand that didn't work so I tried adding those classes to eachTable.Headand it still didn't work:Does anyone have any suggestions/solutions?
Beta Was this translation helpful? Give feedback.
All reactions