You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b4992d5
Browse filesBrowse the repository at this point in the historyBrowse files
Let a table column grow to fill the table's width (#35)
* Let a table column grow to fill the table's width
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
* Give a filling table's columns their drawn proportions in HTML
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 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: MarkupString/Layout/Blocks/Table.cs
+38-2Lines changed: 38 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,8 @@ namespace MarkupString.Layout;
5
5
/// <summary>
6
6
/// Rows under column headings. Columns grow to fit their widest cell; when the table is too wide, the
7
7
/// columns that may wrap give way first, then the least important columns are left out, and when
8
-
/// even one column will not fit each row becomes a card of labelled values.
8
+
/// even one column will not fit each row becomes a card of labelled values. When it is narrower than
9
+
/// its width, the columns that <see cref="TableColumn.Grow"/> share what is left, so the table fills it.
9
10
/// </summary>
10
11
/// <param name="Columns">The columns, in order.</param>
11
12
/// <param name="Rows">The rows, a cell per column; a short row is padded with empty cells. A cell's text takes its column's alignment unless it sets its own.</param>
0 commit comments