Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fixed size for group divs to fix alignment with zoom #4483

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

chey-to-mozg
Copy link

@chey-to-mozg chey-to-mozg commented Apr 26, 2024

This fixes #4407

The problem occurs either with a screen zoom (default 150% for laptops) or browser zoom other than the default.

Root of the problem: floating point calculation errors of borders in browser stackoverflow answer

Changes:

  • added fixed width for group element after header initialization. The initialized header is required to preserve the behavior of the offsetWidth property, which is used to calculate the column width.

Testing:
Tested on Chrome, Firefox, Edge.
Firefox still have issue related to scrolling, but its not additive error anymore, just misalignment in some scrollbar positions

@AndyFilin
Copy link

This change seems to fix the original issue 👍

@olifolkerd
Copy link
Owner

@chey-to-mozg Have you checked how this change affects resizable columns, and also a fitColumns layout when you resize the table?

Cheers

Oli :)

@chey-to-mozg
Copy link
Author

@olifolkerd Hi, Oli!
Sorry for late response

Here are some screenshots (browser zoom 150%):
fitColumns layout without fix:
image

fit columns layout with fix (fixed gaps):
image

default layout with resized column by dragging without fix:
image

default layout with resized column by dragging with fix:
image

Is this what you meant in your question?

Regards,
Denis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Column groups header misaligned with table body
3 participants