opencode-responsive-tables
v0.0.1
Published
Responsive Markdown table formatter for OpenCode — aligned tables when they fit, stacked cards when they don't
Maintainers
Readme
opencode-responsive-tables
An OpenCode plugin that makes markdown tables readable on any screen. Tables that fit your terminal are left alone — tables that don't are reformatted as stacked cards.
Before / After
A table too wide for the terminal:
| Name | Age | City | Country | Email |
| ----- | --- | -------- | ------- | ----------------- |
| Alice | 30 | New York | USA | [email protected] |
| Bob | 25 | London | UK | [email protected] |Becomes:
**Name**: Alice
**Age**: 30
**City**: New York
**Country**: USA
**Email**: [email protected]
────────────────────────
**Name**: Bob
**Age**: 25
**City**: London
**Country**: UK
**Email**: [email protected]Tables that fit are passed through unchanged. Tables inside code fences are never touched.
Install
{
"plugin": ["opencode-responsive-tables"]
}How it works
- Detects markdown tables in assistant output
- Measures each table's display width (markdown-aware — bold, links, and code are measured by their rendered width, not their raw syntax)
- If the table fits the terminal → pass through as-is
- If the table overflows → reformat as stacked key-value cards with
─separators - No terminal width (e.g. OpenCode web) → all tables pass through
Pairs well with
Works great alongside @franlol/opencode-md-table-formatter, which aligns and prettifies tables that fit. This plugin picks up where that one leaves off — reformatting the tables that are still too wide as stacked cards.
