| name | table |
| description | Renders interactive sortable, filterable tables in the browser using pure vanilla HTML/CSS/JS — no external dependencies. Use when the user wants to compare alternatives, show a feature matrix, display structured data, create a comparison table, render a sortable table, show options side-by-side, or visualize rows and columns of data. Always renders live in browser — never as static text. |
| allowed-tools | Write, Edit, mcp__chrome-devtools__new_page, mcp__chrome-devtools__navigate_page, mcp__chrome-devtools__wait_for, mcp__chrome-devtools__take_screenshot, mcp__chrome-devtools__list_pages |
| category | tool |
| output_types | ["data","presentation"] |
| complexity | moderate |
| cost_profile | low |
| maturity | beta |
| metadata_source | inferred |
Table
Renders interactive sortable, filterable tables in the browser by writing a zero-dependency HTML file and opening it via Chrome DevTools.
Workflow
- Extract columns and rows — identify column names, value types (text, number, badge, rating, boolean, tag), and all row data from user context. See TEMPLATE.md for column type definitions.
- Map column types — assign a
type to each column: text, number, badge, rating, boolean, or tag. See TEMPLATE.md for rendering rules per type.
- Choose a unique filename — use
/tmp/table.html by default. If a file with that name already exists (check with Bash ls /tmp/table.html), use a descriptive slug instead (e.g. /tmp/genai-taxonomy.html, /tmp/db-comparison.html). Never silently overwrite an existing file with unrelated content.
- Write the HTML file — write a complete self-contained file to the chosen path using the vanilla JS template. See TEMPLATE.md for the full template with sort and filter implementation.
- Render in browser — follow
_shared/chrome-devtools-render.md to open the HTML file, wait for render, screenshot, and fix-and-reload if needed. wait_for the text of the first column header. See TROUBLESHOOTING.md for table-specific fixes.
Self-review checklist
Before delivering, verify ALL:
Golden rules
Hard rules. Never violate these.
- Always define colors as CSS variables on
:root. Never write a hex color value directly into an element style. Every color used must reference a var(--token).
- Always include both sort AND filter. A table missing either feature is incomplete. Both must be present in every output, even for small datasets.
- Never use an external library. Implement sort and filter in plain JS. The complete implementation is under 50 lines. See TEMPLATE.md.
- Always use
position: sticky; top: 0 on thead. Apply this to every table regardless of row count.
- Always call
wait_for before take_screenshot. Wait on the first column header text string. Never screenshot immediately after new_page.
- Always use
overflow-x: auto on the table container. Without it, wide tables break the page layout.
- Always
.toLowerCase() both sides in the filter comparison. Case-sensitive filtering breaks on mixed-case data.
Reference files
| File | Contents |
|---|
| TEMPLATE.md | Complete vanilla JS HTML template with full sort and filter implementation, CSS design tokens, column type rendering rules |
| TROUBLESHOOTING.md | Failure diagnosis table: symptoms, likely causes, and fixes |