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

fix(layout): resolve desktop table layout issue #10352

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ShubhamOulkar
Copy link

@ShubhamOulkar ShubhamOulkar commented Jan 20, 2024

Summary

Fixes #10346

Problem

The table looks skewed on the left side and gets cut off on the right side, making it appear uneven and not well-aligned.

Solution

Adjusted the table width from vw/cal() to filling the entire container, ensuring a consistent 100% width display for improved alignment.

Screenshots

Before

1

After

2

How did you test this change?

Ran yarn dev locally and looked at the following pages:

@ShubhamOulkar ShubhamOulkar requested a review from a team as a code owner January 20, 2024 10:32
@caugner caugner changed the title Resolve desktop table layout issue fix(layout): resolve desktop table layout issue Jan 22, 2024
@caugner
Copy link
Contributor

caugner commented Jan 25, 2024

@ShubhamOulkar Thank you for taking the time to investigate the issue and open this PR. 🙌

Unfortunately, the proposed changes are not sufficient and break the BCD tables on smaller screens. The BCD tables - in contrast to other tables on the site - are additionally wrapped in a figure.table-container-inner to make them scroll horizontally. In fact, this is where the 3rem/6rem of the .table-container come from:

.table-container-inner {
min-width: max-content;
padding: 0 3rem;

See: http://localhost:3000/en-US/docs/Web/CSS/text-overflow#browser_compatibility

Before (main) After (this PR)
image image

The solution for the problem will need to account for both kind of tables, regular tables (that don't scroll horizontally) and BCD tables (that scroll horizontally).

@ShubhamOulkar Do you want to further look into this? For now, I will go ahead and convert your PR to draft.

@ShubhamOulkar
Copy link
Author

@caugner, Thanks for suggesting BCD tables. I didn't tested any of these table. I will look into it.

@caugner
Copy link
Contributor

caugner commented Jan 26, 2024

@caugner, Thanks for suggesting BCD tables. I didn't tested any of these table. I will look into it.

@ShubhamOulkar Could you have a look at #9974 and test it locally? I think it should solve the issue by avoiding that the BCD styles interfere with unrelated table containers.

@github-actions github-actions bot added the idle label Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MDN layout issue: tables too wide when viewport is 769px and 1200px
2 participants