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

Find way to avoid wrapping dates in tables in mobile view #80

Open
zkamvar opened this issue Apr 26, 2023 · 4 comments
Open

Find way to avoid wrapping dates in tables in mobile view #80

zkamvar opened this issue Apr 26, 2023 · 4 comments
Labels
bug Something isn't working {varnish} HTML/CSS/JS templates

Comments

@zkamvar
Copy link
Contributor

zkamvar commented Apr 26, 2023

Not sure how to do this because dates are incredibly hard to parse, but there is a situation that was found where dates wrap in mobile view: carpentries/lesson-transition#65

partial screenshot of mobile view where a table containing ISO 8601 formatted dates are wrapped to the day

@zkamvar zkamvar added the bug Something isn't working label Apr 26, 2023
@bencomp
Copy link
Contributor

bencomp commented May 22, 2023

Did you fix this already? Looking at this table in Firefox's responsive mode, the issue is not very prominent anymore.
My suggestion would be to use more of the screen when space is tight. Set smaller margins and a smaller gap between the columns. It will not work for all tables, but it should work for this one.

@zkamvar
Copy link
Contributor Author

zkamvar commented May 24, 2023

Hi @bencomp,

No, this has not been fixed. Checking on my device (an iPhone SE, which I have gotten several comments about how cute it is because it's so small), it's still an issue on Firefox and Safari mobile.

Set smaller margins and a smaller gap between the columns. It will not work for all tables, but it should work for this one.

It's weirdly difficult to define how wide a table should be using markdown: https://pandoc.org/MANUAL.html#tables

I think the solution may be to set the overflow-wrap: word property to tables: https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-wrap

@bencomp
Copy link
Contributor

bencomp commented May 24, 2023

It's weirdly difficult to define how wide a table should be using markdown: https://pandoc.org/MANUAL.html#tables

I should have clarified that I meant this be changed in the CSS. Looking at your screenshot I feel the gap between the columns is quite big, as well as the margins on the left and right of the table. If your phone is cute/small, better make good use of the available space!
This would not rule out setting overflow-wrap: word as well.

@zkamvar
Copy link
Contributor Author

zkamvar commented May 24, 2023

Ah,

This turns out to be a problem with the width of the column headers: https://carpentries.github.io/sandpaper-docs/episodes.html#tables

The table headers for the the first table in episode 1 are at a 2:1 ratio and quite long (which is likely from a weird bug in {tinkr} that I'm going to have to suss out).

This causes the table widths to be set at 64% and 36%, respectively:

<table class="table">
  <colgroup>
    <col width="65%">
    <col width="34%">
  </colgroup>
  ...

The solution is to shorten the table widths to their original lengths

@zkamvar zkamvar added the {varnish} HTML/CSS/JS templates label Jun 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working {varnish} HTML/CSS/JS templates
Projects
None yet
Development

No branches or pull requests

2 participants