[x] Include relevant code or preferably a code sandbox
Describe the bug
If the component has pagination enabled, switching between different pages can sometimes cause column widths to change. However, the bigger issue arises when sorting is enabled. If a user clicks on a column to sort it, after the sorting function is executed, a completely different column may end up under their cursor. This issue occurs especially in tables with narrow columns (e.g., displaying short numeric data) or tables with a large number of columns.
To Reproduce
Steps to reproduce the behavior:
Open the default sandbox assigned to the GitHub issue template.
Adjust the slider separating the code view and preview.
Click on the 'Director' column to trigger sorting.
Notice how the columns change their width and their position along the X-axis.
Expected behavior
Columns should retain their width and position during both sorting and page changes in pagination. This is probably not feasible for server-side pagination, but maybe it can be adjusted when that option is disabled.
Issue Check list
styled-components
Describe the bug
If the component has pagination enabled, switching between different pages can sometimes cause column widths to change. However, the bigger issue arises when sorting is enabled. If a user clicks on a column to sort it, after the sorting function is executed, a completely different column may end up under their cursor. This issue occurs especially in tables with narrow columns (e.g., displaying short numeric data) or tables with a large number of columns.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Columns should retain their width and position during both sorting and page changes in pagination. This is probably not feasible for server-side pagination, but maybe it can be adjusted when that option is disabled.
Code Sandbox, Screenshots, or Relevant Code
Default sandbox.
Here the issue is demonstrated on a smaller section of a larger table (1920px width monitor, just a lot of data)
Versions (please complete the following information)