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 table overflow issue on Chromium browsers #1607

Merged
merged 2 commits into from
May 23, 2024

Conversation

Yashasewi
Copy link
Contributor

@Yashasewi Yashasewi commented May 20, 2024

Description

This PR fixes an issue where the table on the "Maintaining the Website Guide" page overflows due to the YouTube URL not wrapping on Chromium-based browsers. The issue was mentioned in this comment.

Steps to Reproduce

  1. Open the "Maintaining the Website Guide" page on a Chromium-based browser (e.g., Google Chrome, DuckDuckGo, Brave) using a desktop or mobile device. here
  2. Scroll down to the table section.

Expected Behavior

The table should display correctly, with the YouTube URLs wrapping to the next line if they exceed the table cell width.

Actual Behavior

On Chromium-based browsers, the YouTube URLs do not wrap, causing the table to overflow horizontally.

Screenshots

Before After
Before After

Testing

  • Tested on Google Chrome (Android)
  • Tested on DuckDuckGo (Android)
  • Tested on Brave (Android)
  • Tested on Mozilla Firefox (Android) (has no effect)
  • Tested on Safari (iOS) [If you have access to an iPhone, please confirm and check this box]

Copy link

netlify bot commented May 20, 2024

Deploy Preview for codingtrain ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 8c154fc
🔍 Latest deploy log https://app.netlify.com/sites/codingtrain/deploys/664ce5a140cb8c00080ea353
😎 Deploy Preview https://deploy-preview-1607--codingtrain.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@dipamsen
Copy link
Member

Are the before after images swapped? 😄

@Yashasewi
Copy link
Contributor Author

Are the before after images swapped? 😄

Now it's looking good … 😂

@fturmel
Copy link
Collaborator

fturmel commented May 21, 2024

This is not working properly for all screen sizes:

Also table-layout:fixed makes all columns equal width, and that's not the optimal use of horizontal space with the type of content that ends up in these tables.

I would propose keeping the table auto layout and applying word breaks in td elements that are not the first column, since those tend to be single words. I think this is all we would need:

.td:not(:first-child) {
  word-break: break-word;
}

@Yashasewi
Copy link
Contributor Author

@fturmel Thank you for the proposed solution. I agree that using table-layout:fixed is not the best approach here . Updated with new solution .

Copy link
Collaborator

@fturmel fturmel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, thanks!

@shiffman
Copy link
Member

Amazing, thank you!!

@shiffman shiffman merged commit 324b7e4 into CodingTrain:main May 23, 2024
5 checks passed
@Yashasewi Yashasewi deleted the fix_table_overflow_in_chromium branch May 23, 2024 15:51
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.

None yet

4 participants