Count markdown table columns before you trust an AI table
Write the header width first. Keep a row only when every line has that many cells.
In short
- Write the header width before you read the chat table.
- Count cells the same way on every row: trim, strip outer
|, split on|. - Keep the table only when every row matches that width.
Example (made up): columns sku, name, qty. Name is Gao ST25, 5kg. A chat that writes Gao ST25 | 5kg as two cells makes four columns.
Same idea as CSV quoted commas.
Write the width you will accept
GFM tables split on pipes. A literal | inside a cell must be escaped as \\| in the source.
| Field | Value |
|---|---|
| width | 3 |
| sample | RICE-5KG · Gao ST25, 5kg · 2 |

A comma in name is fine. A raw | is not.
Count every row
Checked 3 December 2026 with a plain cell counter:
| RICE-5KG | Gao ST25, 5kg | 2 | → 3 keep
| RICE-5KG | Gao ST25 | 5kg | 2 | → 4 discard

Wrong width is enough to discard — then compare cell text.
Ask, then count
Return one GFM table only.
Headers: sku, name, qty
Sample row: RICE-5KG | Gao ST25, 5kg | 2
Escape | inside cells as \|.
I will count cells on every row.

Do not delete pipes by eye. Ask again from the sheet.
Related
Share