worktrunk icon indicating copy to clipboard operation
worktrunk copied to clipboard

alignment of tables in web

Open max-sixty opened this issue 8 months ago • 1 comments

the alignment of tables on https://worktrunk.dev/list/ is not quite correct; why is it different on the web to the CLI?

Image

max-sixty avatar Mar 26 '26 17:03 max-sixty

Thanks for reporting this! I investigated the rendering pipeline and here's what I found:

Two types of "tables" on the list page:

  1. Terminal output examples ({% terminal() %} blocks) — These render wt list output in a <pre> block using JetBrains Mono. Column alignment relies on all characters having equal width. Unicode symbols (↕, ⇡, ↓, ⊂, ⤴, etc.) may render at different widths than ASCII characters in the web font or its fallbacks, causing column misalignment. In a terminal emulator, fixed-width rendering is enforced for all characters, so alignment is always correct.

  2. Reference tables (Columns, Status symbols, CI status, etc.) — These are markdown tables rendered as HTML <table> elements by Zola. The CLI renders the same content via termimad with box-drawing characters. These use fundamentally different layout engines, so visual differences are expected.

If the screenshot shows misaligned columns in the terminal output examples, the root cause is likely Unicode character widths in JetBrains Mono (or fallback fonts when glyphs are missing from JetBrains Mono). Some possible fixes:

  • Render the terminal examples as an HTML <table> instead of a space-padded <pre> block
  • Use a font that guarantees equal width for these specific Unicode symbols
  • Add CSS letter-spacing adjustments for the affected characters

I wasn't able to write a reproduction test since this is a browser font rendering issue. A maintainer will take a closer look.

worktrunk-bot avatar Mar 26 '26 17:03 worktrunk-bot