Skip to content

Let a table column grow to fill the table's width - #35

Merged
HarryCordewener merged 3 commits into
mainfrom
claude/adopt-layout-functions-hc9kwm
Oct 7, 2026
Merged

HarryCordewener merged 3 commits into
mainfrom
claude/adopt-layout-functions-hc9kwm

Conversation

@HarryCordewener

Copy link
Copy Markdown
Member

Before: a Table was only as wide as its cells. Inside a box, or on a screen whose rules span the width, its columns and heading rule stopped partway across.

After: a column with Grow takes a share of the width left over once every column fits, so the table fills its width, heading rule included. In HTML such a table is ms-fill (width: 100% in LayoutCss), and each growing heading carries its share as a percentage width.

How: Table.Widths hands the spare cells to the growing columns by share (Spread). The cells lost to rounding go to the first growing column, and no column grows past its Max. A table too wide for its width is unchanged. The serializer keeps the share as gr. Tests cover filling, shares, too-wide, Max, HTML and the round trip. SharpMUSH uses it for the +help/+scene tables (SharpMUSH/SharpMUSH#1640).

🤖 Generated with Claude Code

https://claude.ai/code/session_018eAjtsQTFqWAeWQMc7ebNo


Generated by Claude Code

A table was only as wide as its cells, so in a box or a screen whose
other lines span the width its heading rule and columns stopped short.
TableColumn.Grow gives a column a share of the width left over once every
column fits; a table with one fills its width. HTML marks it ms-fill
(width: 100%) and gives each growing heading its share as a percentage.
A growing column stops at its Max, and the serializer keeps the share.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018eAjtsQTFqWAeWQMc7ebNo
@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Note

Currently processing new changes in this PR. This may take a few minutes, please wait...

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: f7e595c6-325d-4ba0-843e-d57afc13c271
📥 Commits

Reviewing files that changed from the base of the PR and between 3f368d7 and 189fb23.

📒 Files selected for processing (7)
  • CHANGELOG.md
  • MarkupString.Html/Emitters/LayoutHtml.cs
  • MarkupString.Html/LayoutCss.cs
  • MarkupString.Tests/Layout/WidgetLayoutTests.cs
  • MarkupString/Layout/Blocks/LayoutJson.cs
  • MarkupString/Layout/Blocks/Table.cs
  • MarkupString/PublicAPI.Unshipped.txt
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

claude added 2 commits October 7, 2026 07:19
A percentage width on the growing heading made the browser squeeze every
other column to its narrowest. The table now carries a colgroup with
each column's share of the width as the text layout draws it
(Table.ColumnWidths), and a page narrow enough to hide columns lets the
rest share the width freely.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018eAjtsQTFqWAeWQMc7ebNo
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018eAjtsQTFqWAeWQMc7ebNo
@HarryCordewener
HarryCordewener merged commit b4992d5 into main Oct 7, 2026
6 of 7 checks passed
@HarryCordewener
HarryCordewener deleted the claude/adopt-layout-functions-hc9kwm branch October 7, 2026 07:28
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.

2 participants