Tables

readrun uses one table system for ordinary Markdown tables. There are no table tags, modes, or per-table directives: every Markdown table follows the same content-aware sizing algorithm.

The aim is simple: short columns stay compact, spare width goes to columns that need it, and tables become horizontally scrollable only when their useful base width cannot fit inside the reading column.

The sizing algorithm

Each table has three important widths:

  • target column width — the shared width requested by the table slider, initially 28ch.
  • content width — the measured width each column needs to keep its widest cell on one line.
  • available width — the current readrun reading column width.

For each column, readrun first computes a base width:

txt
base width = min(content width, target column width)

So a column that only needs 12ch does not get forced to 28ch. A column that needs 60ch starts at the target width and may receive extra space later.

Then readrun sums the base widths.

If the base table is already wider than the available reading column, readrun stops there: the table keeps those base widths and becomes horizontally scrollable.

If the base table fits, readrun calculates the spare width and distributes it to columns with unmet content demand:

txt
unmet demand = content width - base width

Columns receive spare width in proportion to their unmet demand. If all content widths are satisfied, any leftover page width remains unused, so narrow tables stay narrow and centred.

Compact table

Short columns shrink to their content width instead of stretching across the page.

table
3 cols · 3 rows
col width
28ch
SymbolMeaningTypical value
LLSpan length6 m
wwUniform load4.2 kN/m
EEElastic modulus200 GPa

Worked example: proportional spare width

Suppose the target width is 30, the available width is 100, and the measured content widths are:

txt
[20, 60, 40]

The base widths are:

txt
[min(20, 30), min(60, 30), min(40, 30)]
= [20, 30, 30]

The base table is 80, so there are 20 units of spare width.

The unmet demand is:

txt
[0, 30, 10]

The second column has three quarters of the unmet demand, so it gets three quarters of the spare width. The third column gets the remaining quarter.

txt
extra = [0, 15, 5]
final = [20, 45, 35]

Here is a table shaped like that example: short first columns, plus one explanation column that should receive most of the extra width.

table
3 cols · 3 rows
col width
28ch
StepCheckExplanation
1InputsCollect span, loads, support conditions, and material assumptions.
2ModelPick the simplest model that preserves the behaviour you are checking.
3ResultReport the governing value and the assumption that controls it.

Naturally narrow table

If all content fits before the table reaches the reading column width, readrun leaves the table narrow and centres it.

table
2 cols · 2 rows
col width
28ch
ConceptMeaning
Target widthShared width requested by the slider.
Content widthWidth needed by a column’s widest one-line cell.

Wide table

If the base widths cannot fit, readrun does not squash the columns. The table becomes horizontally scrollable, and the first column becomes sticky while scrolling.

table
7 cols · 3 rows
col width
28ch
Load caseDead loadLive loadWind loadSeismic loadCombinationGoverning note
LC112.4 kN8.1 kN0.0 kN0.0 kN1.35D + 1.5LLong serviceability note that intentionally keeps the row wide.
LC212.4 kN0.0 kN6.8 kN0.0 kN1.2D + 1.5WWind governs lateral drift in this example.
LC312.4 kN3.5 kN0.0 kN5.2 kND + 0.3L + ESeismic case included to show many columns.

Inline Markdown inside tables

Table cells use the same inline Markdown renderer as normal prose. Inline code, links, and math should render correctly and still participate in width measurement.

table
3 cols · 3 rows
col width
28ch
KindExampleWhy it matters
Codevery_long_identifier_nameCode often has fewer natural wrap points.
Linkreadrun docsLinks should keep their normal styling inside cells.
MathE=mc2E = mc^2Math should render through KaTeX rather than disappearing or being measured as empty text.