Skip to content

Center-aligned column header adds left padding even if no action buttons in headerΒ #512

@VARILITE

Description

@VARILITE

mantine-react-table version

v2.0.0-beta.9

react & react-dom versions

v18.3.1

Describe the bug and the steps to reproduce it

When using the <MRT_Table/> element, disabling all column actions, and setting the header alignment to center, left padding is added to the header. I assume it's to compensate the width when column actions are in use.

Disabled columns actions with:

enableColumnActions: false,
enableColumnFilters: false,
enablePagination: true,
enableSorting: false,

Aligned column with:

{
  accessorKey: "confirm",
  header: "Confirmation",
  mantineTableHeadCellProps: {
    align: "center",
  },
  mantineTableBodyCellProps: {
    align: "center",
  },
},

I noticed the column header label element has the class --mrt-table-head-cell-labels-padding-left

Minimal, Reproducible Example - (Optional, but Recommended)

https://codesandbox.io/p/sandbox/brave-meadow-6dykgj?file=%2Fsrc%2FApp.js%3A30%2C11

Screenshots or Videos (Optional)

Image

Do you intend to try to help solve this bug with your own PR?

No, because I do not know how

Terms

  • I understand that if my bug cannot be reliably reproduced in a debuggable environment, it will probably not be fixed and this issue may even be closed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    V2Issue with MRT V2

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions