Make WordPress Core

Opened 3 years ago

Closed 5 months ago

Last modified 3 months ago

#54120 closed enhancement (wontfix)

Twenty Fifteen: Fixed table layout

Reported by: roenbaeck's profile Roenbaeck Owned by:
Milestone: Priority: normal
Severity: minor Version:
Component: Bundled Theme Keywords: 2nd-opinion dev-feedback needs-patch close
Focuses: css Cc:

Description (last modified by sabernhardt)

The CSS for Twenty Fifteen contains a line forcing fixed layout for tables:

   table {
      border-collapse: separate;
      border-spacing: 0;
      border-width: 1px 0 0 1px;
      margin: 0 0 1.6em;
      table-layout: fixed; /* Prevents HTML tables from becoming too wide */
      width: 100%;
   }

This causes unexpected behavior since you in Gutenberg have the option to select between a fixed or dynamic layout for table blocks, but this has no effect.

Change History (10)

#1 @sabernhardt
3 years ago

  • Component changed from Themes to Bundled Theme
  • Description modified (diff)
  • Keywords 2nd-opinion added
  • Version 5.8.1 deleted

Thanks for the report!

Twenty Sixteen also has fixed layout for the table element, as well as on the .wp-block-table class (which is now assigned to the table's container instead).

The table element styles probably should stay the same to avoid changing the layout of existing tables, especially if they were created with another editor. Would something like this be fair?

.wp-block-table table:not(.has-fixed-layout) {
    table-layout: auto;
}

#2 @desrosj
2 years ago

  • Summary changed from Fixed table layout in Twenty Fifteen to Twenty Fifteen: Fixed table layout

#3 @karmatosed
7 months ago

  • Keywords dev-feedback added

This ticket was mentioned in Slack in #core-themes by karmatosed. View the logs.


6 months ago

#5 @karmatosed
6 months ago

  • Milestone changed from Awaiting Review to Future Release

#6 @karmatosed
5 months ago

  • Keywords needs-patch added

#7 @sabernhardt
5 months ago

  • Keywords close added
  • Type changed from defect (bug) to enhancement

I cannot recommend my earlier suggestion. Except for anyone who overrode this theme, everyone else who has added a Table block would have the fixed layout, regardless of whether they made a Style choice for the block. Editing the default style now would surprise people, and probably a significant number of them would not welcome the change.

Maybe the theme(s) could register an extra Style variation, if someone is interested in making a patch like that. However, I have already closed at least one ticket about a block's default Style setting that matches another Style option whose name fits both (#57850).

#8 @karmatosed
5 months ago

  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I agree that closing this makes sense so second that. Thank you @sabernhardt. I will now move to do that and thank you everyone who collaborated. We have as stated already closed one ticket similar.

#9 @sabernhardt
3 months ago

#61927 was marked as a duplicate.

#10 @sabernhardt
3 months ago

I inaccurately said "Style variation," which would be like the Stripes variation. Fixed width is a block setting, and fixed became the default for that option in GB49672 (since Gutenberg 18.0 or WordPress 6.6).

However, I still think the themes should not be changed for this because most Table blocks have been created between December 2018 and July 2024. Fixed table-layout has always been the default for Twenty Fifteen and Twenty Sixteen.

Note: See TracTickets for help on using tickets.