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.

Published 2026-12-03 · Translation: VI

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

Known width 3; a raw pipe inside a cell opens a new column.

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

Three cells match; four cells slide qty.

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.

Write width → ask → count → match.

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

Share

X Facebook LinkedIn
Educational content only. Rankings reflect stated criteria at the update date—not investment advice or permanent performance guarantees.