-
Notifications
You must be signed in to change notification settings - Fork 38
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix table columns breaking content #154
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very clear and reasoned lets get this merged 馃憤
CHANGELOG.md
Outdated
@@ -1,5 +1,10 @@ | |||
# Changelog | |||
|
|||
## Unreleased | |||
|
|||
Remove the `table-layout: fixed` style from the tables in tech' docs content, mainly due to it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not blocking by ideally the changelog should say what is fixed for users, not the details of what we've been doing internally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. Does this change help?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, I'd prefer if it didnt require looking in the link to understand the summary but good enough 馃憤 Thanks Tom
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good point actually. I've rewritten it in this commit.
a4a20f1
to
6ec26ec
Compare
table-layout
to auto
This removes the
table-layout: fixed
style for tables in tech' docs content, introduced as part of ffa2261.Why did we fix our table layouts?
It was introduced as part of a pull request that made 2 changes:
max-width: 40em
for<pre>
blocks was removed to stop issue #100table-layout: fixed
was added to fix the problemsmax-width: 40em
solvedWhy did we constrain the width of our
<pre>
tags?The comments above
max-width: 40em
mention<pre>
tags pushing tables to be larger than the main column (see ffa2261#diff-d7f12a4697fd2195a8c62339caee5c77L122).Why should be revert to auto-sized layouts?
1. It causes an issue with existing tables
It created issue #133 with Notify's tech' docs.
2. Removing it shouldn't effect any other existing tables
I went through the main users of this gem and found all the tables in them (thanks @NickColley for their details):
https://docs.google.com/spreadsheets/d/1OZGQifZIw0I2GXqmrp78DoI3R2sfcxn5IcFq3Y5RXqA/edit#gid=0
I can't find any tables that use
<pre>
tags in table cells, just inline<code>
blocks.I also tested all these tables without
table-layout: fixed
and none of them displayed in ways that distorted the content or made the table wider than the main column.3. Tables that are too wide don't break the main column
Tables are wrapped in a fixed-width container which scrolls. This means that if they're wider than the main column they don't break it and users can scroll to access their content. For example:
https://www.docs.verify.service.gov.uk/legacy/build-ms/msa/#msa-tls-certificates
We probably shouldn't be using block-level code in tables
Note: this point is just my opinion 馃檪.
Middleman's markdown parser [Redcarpet uses PHP-Markdown style tables](https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use. In its docs, PHP-Markdown says it allows 'span level formatting' in its tables:
https://michelf.ca/projects/php-markdown/extra/#table
There's no mention of official support for block-level formatting, like
<pre>
.