docs: Possibly fix table display issue #18187
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I wasn't able to reproduce #11106, but I'm quite sure this PR will fix the issue.
From the screenshots that people posted in the issue, it looks like the table is displayed in a variable width (non-monospace) font. When setting the font to a non-monospace, namely
serif
, in the Firefox developer tools, then the output looks indeed wrong (see "serif" in the bottom right):And if I directly set
Then Firefox (and Chrome; tested also) cannot find that font and falls back to a non-monospace font:
But this doesn't explain the issue, because normally devices should fallback to a monospace font due to
So essentially when substituting the variables, this should mean that
which should work fine everywhere.
What could be the root-cause though is the
!important
part. Maybe certain browsers substitute that as:which could then make the line invalid and then the browser falls back to a non-monspace font.
A solution to this could be to remove the
!important
.This PR suggests an even more robust solution, namely to override the
font-family
and thus sidestep thevar
:All devices should have a monospace font available, so although this might be slightly less pretty, it should work everywhere. Also, since this is less dependent on which fonts are available system-wide, issues should occur for everyone instead of in specific situations only.