Skip to content

Table does not resize correctly in display: grid context #361

@tiwe-ppi

Description

@tiwe-ppi

Hello there, we stumbled upon an interesting datatables bug.

When there is a table in a container with display: grid, the table can only grow but never shrink when the container/window is resized. This happens when the scrollY option is set. If I change the containers display property to simply block it works as expected meaning the tables grows and shrinks.

I created a codepen with an easy toggle for the display property:
https://codepen.io/timw-ppi/pen/WbrjgBy

The use case is the following: We need to place two tables next to each other (with buttons in between) and the tables should have the same size. display: grid is perfect for this. We tried display: flex but that causes ResizeObserver errors in datatables. We will try to find a different workaround for now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions