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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix table columns breaking content #154

Merged
merged 3 commits into from
Nov 13, 2019
Merged

Conversation

tombye
Copy link
Contributor

@tombye tombye commented Nov 12, 2019

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:

  1. the max-width: 40em for <pre> blocks was removed to stop issue #100
  2. table-layout: fixed was added to fix the problems max-width: 40em solved

Why 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>.

Copy link
Contributor

@NickColley NickColley left a 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
Copy link
Contributor

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.

Copy link
Contributor Author

@tombye tombye Nov 12, 2019

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?

Copy link
Contributor

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

Copy link
Contributor Author

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.

@tombye tombye force-pushed the remove-table-layout-fixed branch 2 times, most recently from a4a20f1 to 6ec26ec Compare November 13, 2019 10:33
@NickColley NickColley merged commit 9ac03a2 into master Nov 13, 2019
@NickColley NickColley deleted the remove-table-layout-fixed branch November 13, 2019 10:34
@NickColley NickColley changed the title Reset table-layout to auto Fix table columns breaking content Nov 14, 2019
@NickColley NickColley mentioned this pull request Nov 14, 2019
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

2 participants