Skip to content

Table - scrollable body, sticky header #767

@pchabros

Description

@pchabros

Hi, I'm trying to create table with scrollable body and sticky header.
When I use native HTML tags everything works as expected:

<div className="max-h-96 overflow-auto">
  <table>
    <thead className="sticky top-0">
      {...}
    </thead>
    <tbody>
      {...}
    </tbody>
  </table>
</div>

After replacing with radix Table tags header is no longer sticky:

<div className="max-h-96 overflow-auto">
  <Table.Root>
    <Table.Header className="sticky top-0">
      {...}
    </Table.Header>
    <Table.Body>
      {...}
    </Table.Body>
  </Table.Root>
</div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions