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

Address irregular spacing issue within table cells #786

Open
NMSalmon opened this issue Apr 16, 2021 · 3 comments
Open

Address irregular spacing issue within table cells #786

NMSalmon opened this issue Apr 16, 2021 · 3 comments
Assignees
Labels
bug Something isn't working cool down good first issue Small - 3 Planning Poker T-Shirt Size

Comments

@NMSalmon
Copy link

Feature Description

If the contents of a table cell aren't fully contained in one "paragraph" - that is, if I hit enter while typing or copy-paste content that includes multiple lines, the second portion of the text within the published cell looks bigger and more widely spaced than the top portion of the text.

spacing issue in pressbooks tables

Feature Use Case

Textbooks often compare content using tables that include multiple lines or paragraphs within individual cells.

Other Notes

My apologies if this isn't the right place to put this issue or if it's been reported elsewhere. (I tried doing a search but am still getting to know the intricacies of the repository and the etiquette of making these posts!)

@SteelWagstaff
Copy link
Member

We're targeting .chapter table and applying font-size .9em, but the subsequent content is wrapped in autop and that content is targeted by our .chapter p rule, which has font-size 1.125em. We can fix in McLuhan/Buckram.

@SteelWagstaff SteelWagstaff transferred this issue from pressbooks/ideas Jun 6, 2021
@SteelWagstaff SteelWagstaff added bug Something isn't working Small - 3 Planning Poker T-Shirt Size labels Jun 6, 2021
@SteelWagstaff SteelWagstaff self-assigned this Jul 29, 2022
@SteelWagstaff
Copy link
Member

SteelWagstaff commented Aug 9, 2023

We've found that the issues we're seeing here appear to stem from two things:

  1. Initial content placed inside of a table cell is not wrapped in auto p but is rendered as raw HTML inside of a <td> element. See Automatic <p> tags after first paragraph in table cells with multiple paragraphs #935. Subsequent new lines are wrapped <p> elements which have styling rules already written for them. The same is true for list elements.
  2. We have some Buckram defaults which don't match other elements when it comes to font-size and line-height. For example, see https://buckram.pressbooks.org/#elements-variable-table-line-height + https://buckram.pressbooks.org/#elements-variable-table-td-line-height (most paragraphs are 1.5) and https://buckram.pressbooks.org/#elements-variable-table-font-size (most elements inside of tables are 1.125rem).

@greatislander
Copy link
Contributor

We're targeting .chapter table and applying font-size .9em, but the subsequent content is wrapped in autop and that content is targeted by our .chapter p rule, which has font-size 1.125em. We can fix in McLuhan/Buckram.

I would recommedn changing the rule for .chapter table as to also target paragraphs within the table:

- .chapter table
+ .chapter table,
+ .chapter table p

@greatislander greatislander removed their assignment Aug 24, 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 cool down good first issue Small - 3 Planning Poker T-Shirt Size
Projects
None yet
Development

No branches or pull requests

3 participants