The Wayback Machine - http://web.archive.org/web/20201012004629/https://github.com/segmentio/evergreen/issues/748
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

Table issue with header row not aligning with content rows. #748

Open
cstrat opened this issue Feb 27, 2020 · 14 comments
Open

Table issue with header row not aligning with content rows. #748

cstrat opened this issue Feb 27, 2020 · 14 comments

Comments

@cstrat
Copy link
Contributor

@cstrat cstrat commented Feb 27, 2020

Unsure if I am doing something wrong, but I can't ever get my header row to align with the content rows. It is always off... either too far left or right.
Even copying the example code from the documentation I can't get it to align:

image

https://codesandbox.io/s/evergreen-table-position-bug-i2el8

I've tried wrapping the table in a but that doesn't seem to help.

In the code-sandbox linked above, how can I fix that alignment issue? Any ideas?

In this one, I've removed the search header and added more columns, still not working.

https://codesandbox.io/s/evergreen-table-position-bug-more-columns-ffgjd

image

The red boxes are just drawn on top and aren't exact - but you can see the gap changes with each column, typically getting more exaggerated with the distance from the left.

@Chrischuck
Copy link
Contributor

@Chrischuck Chrischuck commented Mar 1, 2020

What browser are you on?

I'm on chrome 80.0.3987.87

Screen Shot 2020-03-01 at 15 06 54

Screen Shot 2020-03-01 at 15 07 06

@cstrat
Copy link
Contributor Author

@cstrat cstrat commented Mar 1, 2020

I'm using Brave browser (current version).

Brave is up to date
Version 1.4.95 Chromium: 80.0.3987.122 (Official Build) (64-bit)

Strange thing is, in the docs the tables align perfectly. In my app and code sandbox etc... it doesn't


edit: I tried and it isn't working in vanilla Chrome for me either (checked in incognito mode with no extensions)

Version 80.0.3987.122 (Official Build) (64-bit)

edit 2: Very strange, even using MS Edge browser I see the exact same thing...

image

Strange. This must me something with my PC. Somehow.

@Chrischuck
Copy link
Contributor

@Chrischuck Chrischuck commented Mar 2, 2020

Super weird...I'd expect all of those browsers to have the same behavior... Would it be possible for you to inspect those elements and try to highlight where exactly the discrepancy in width is stemming from?

@cstrat
Copy link
Contributor Author

@cstrat cstrat commented Mar 2, 2020

I think I found where the issue is coming from... but can't work out why it is displaying inconsistently...

See this extra padding on the right (red box is mine).
image

In my browser when checking:

  • All the header cells are equal width: 295.25 (1181px)
    image

  • All the content cells are equal width: 299.5 (1198px)
    image

  • 17px difference, which is the same as that right-padding.

image

My code doesn't add any padding:

<Table>
  <Table.Head>
    <Table.TextHeaderCell>Date</Table.TextHeaderCell>
    <Table.TextHeaderCell>User</Table.TextHeaderCell>
    <Table.TextHeaderCell>Entry</Table.TextHeaderCell>
    <Table.TextHeaderCell>Data</Table.TextHeaderCell>
  </Table.Head>
  <Table.Body>{pages}</Table.Body>
</Table>
@cstrat
Copy link
Contributor Author

@cstrat cstrat commented Mar 2, 2020

I am seeing the same thing in the code-sandbox examples from my original post too...

image

@cstrat
Copy link
Contributor Author

@cstrat cstrat commented Mar 2, 2020

I can confirm that if I simply delete the 17px right padding class in the inspector 📦pr_17px the table aligns perfectly...

paddingRight={scrollbarWidth}

This looks to be the culprit?

Not sure why it is adding padding to the right of the table header because it isn't doing anything differently. Even with no scrollbar visible it has the 17px padding.

No scrollbar visible:
image

Scrollbar visible:
image

@mshwery
Copy link
Contributor

@mshwery mshwery commented Mar 2, 2020

@cstrat
Copy link
Contributor Author

@cstrat cstrat commented Mar 2, 2020

So strange though, I checked my windows settings to see if there is an OS level setting which could be causing grief.
I've toggled this on/off and done full reboot in case the browser doesn't honor the setting immediately. No difference.

There is no scrollbar in the table in any examples where I am seeing the incorrect padding.

image

@cstrat
Copy link
Contributor Author

@cstrat cstrat commented Mar 3, 2020

I updated my earlier comment above where I said it all looks fine in the table documentation.
Looking at the docs again - it does happen there too - but only where there is no scrollbar in the table as @mshwery pointed out...

Wrong.
image

Right.
image

@cstrat
Copy link
Contributor Author

@cstrat cstrat commented Mar 3, 2020

What browser are you on?

I'm on chrome 80.0.3987.87

Screen Shot 2020-03-01 at 15 06 54 Screen Shot 2020-03-01 at 15 07 06

I dont know how you got this to work.
I've even used browser test suites which test websites in VMs (http://browsershots.org/ and https://www.browserling.com/) and I get the same alignment issues.

See below...

Firefox:
image

Chrome:
image

@cstrat
Copy link
Contributor Author

@cstrat cstrat commented Mar 3, 2020

On my Macbook I don't have the issue. The 17px scrollbar class does not get applied.

Windows seems to be the common thread here... are you using Windows?

@Chrischuck
Copy link
Contributor

@Chrischuck Chrischuck commented Mar 3, 2020

I think we're all on macs, let me boot up my windows machine and see what happens after work. I'll update you tonight!

@Chrischuck
Copy link
Contributor

@Chrischuck Chrischuck commented Mar 7, 2020

@cstrat I apologize for the late reply, I came down with a cold the last few days...

Anyway, I was able to reproduce this instantly on a windows machine... so it seems like a pretty common windows issue. I'll dig into it more when I get some time

@cstrat
Copy link
Contributor Author

@cstrat cstrat commented Mar 9, 2020

All good @Chrischuck, no need to explain - hope you're better.

I spent a good amount of time trying to work it out but was left pulling my hair out. 😭

@cstrat cstrat mentioned this issue Apr 20, 2020

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

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.