---
title: "AI Output Table Prompts: 5 Patterns and Excel Paste Fixes (2026)"
description: "To get a table from AI, name the columns, row count, and format, and ban extra text. Includes table, list, and JSON prompt templates and Excel paste fixes."
url: https://cdnping.org/en/blog/ai-output-table-format
language: en
published: 2026-12-05
category: "AI concepts"
tags: ["AI table output","prompts","Excel","JSON","beginner guide"]
source: cdnping.org
license: Free to quote and summarize with a link to the url above.
---
# AI Output Table Prompts: 5 Patterns and Excel Paste Fixes (2026)

To get a table out of an AI, your prompt needs to state four things: which columns, what goes in each column, how many rows, and that nothing besides the table should be written. Add one example row and the format is mostly stable. If you plan to paste into Excel, ask for a Markdown table or plain text separated by tabs or commas, rather than selecting the rendered table in the chat window.

This post has two parts: how to write the prompt, and what to do after you copy the result.

## Why does AI keep giving me messy tables?

A large language model generates text token by token. It has no idea where your "table" will end up. If you only say "put this in a table," it picks the number of columns and the column names on its own, and often adds an explanation before and after. Ask the same question several times and the columns can differ each time.

So the problem is usually a loose prompt, not a weak model. Writing the format down as a requirement works better than regenerating over and over.

## What should the prompt say to get a table?

A template you can use as-is:

```
请把下面的内容整理成 Markdown 表格。
列：日期 | 事项 | 负责人 | 状态
要求：
1. 只输出表格，表格前后不要加任何说明文字
2. 一条事项一行，不要合并单元格
3. 信息缺失的单元格填"无"，不要自己编造
4. 状态只能是"未开始""进行中""已完成"三选一

内容：
……
```

The template above is in Chinese. In English it reads:

```
Turn the content below into a Markdown table.
Columns: Date | Task | Owner | Status
Rules:
1. Output only the table, with no text before or after it
2. One task per row, no merged cells
3. Fill missing cells with "N/A"; do not make anything up
4. Status must be one of "Not started", "In progress", "Done"

Content:
...
```

What each phrasing does:

- "Columns: A | B | C": fixes the column names and order so they don't change between runs.
- "Output only the table, no explanation": makes the result ready to copy.
- "Fill missing cells with 'N/A'; do not make anything up": reduces the tendency to invent values just to fill a cell.
- "This column must be one of X, Y, Z": constrains the values, so filtering and counting later won't break.
- Give one example row, such as `2026-11-03 | Reconciliation | Alex | In progress`. An example works better than a description. This is the idea behind few-shot prompting; see [Giving AI examples: how to write few-shot prompts](/en/blog/few-shot-examples-prompt).

## How do I ask for lists and fixed formats?

Not everything belongs in a table. If the content is a set of short, parallel items, a list is more natural:

```
列出 5 条要点，每条一行，以"- "开头，每条不超过 20 个字，不要编号，不要开场白。
```

In English: "List 5 key points, one per line, each starting with '- ', each no longer than 20 words, no numbering, no opening remarks." (The original limit is 20 Chinese characters.)

When you need a fixed text structure (a weekly report or meeting minutes, say), paste the template in and tell the AI to "fill in this template and don't change the headings":

```
按下面的格式输出，标题和顺序不要改：
【本周完成】
【下周计划】
【风险与求助】
```

In English: "Use the format below. Do not change the headings or their order: [Done this week] [Plan for next week] [Risks and asks]."

The more specific the format requirements, the better. If the answers themselves are too vague, see [What to do when AI answers are too generic](/en/blog/ai-answer-too-generic-fix). For more general prompt writing, see [How to write prompts: a four-part formula beginners can reuse](/en/blog/how-to-write-prompts-beginner).

## What if I need JSON?

If the output will be read by a program, use JSON and spell out the fields:

```
输出一个 JSON 数组，每个元素包含字段：name（字符串）、qty（整数）、price（数字）。
只输出 JSON 本身，不要加任何说明文字。
```

In English: "Output a JSON array. Each element has the fields name (string), qty (integer), and price (number). Output only the JSON itself, with no explanatory text."

In a chat window this is usually enough, but it does not guarantee a program can parse the result every time. Occasionally there is an extra sentence or a missing bracket. For long-term use in code, use the JSON mode or structured output feature your API provides, and validate in your code. Check the official documentation of the service you use for exact parameters. See [Getting LLMs to output JSON reliably: JSON mode and structured output](/en/blog/llm-json-structured-output).

## What if the format breaks when I paste into Excel or a document?

Common cases and fixes:

| Symptom | Cause | Fix |
| --- | --- | --- |
| Everything lands in one column after pasting | Markdown text with `\|` was not recognized as a table | Ask the AI for tab-separated text instead, or in Excel use "Data > Text to Columns" with `\|` as the delimiter (menu names depend on your Excel version) |
| An extra row of `---` appears | The Markdown header separator line | Delete that row after pasting |
| Long numbers turn into scientific notation, leading zeros disappear | Excel automatically treats text as numbers | Set the target columns to "Text" format before pasting |
| Dates change to another format | Excel auto-detects dates | Same fix: set to Text first, or have the AI always output `YYYY-MM-DD` |
| Line breaks inside a cell split the row | The content itself contains line breaks | Add "no line breaks inside cells" to the prompt |
| Table borders vanish after pasting into a document | The target app does not understand Markdown | Use the document app's built-in "convert text to table," or have the AI output CSV, save it as .csv, and open that |

The easiest approach is to state the purpose up front:

```
输出 CSV 格式，第一行是表头，字段用英文逗号分隔，含逗号的内容用英文双引号包起来，只输出 CSV 内容。
```

In English: "Output CSV. The first row is the header, fields are separated by ASCII commas, any value containing a comma is wrapped in ASCII double quotes, and output only the CSV content."

Save the result as a .csv file and open it in Excel. If Chinese text shows up garbled, save again as UTF-8 with BOM, or use "From Text/CSV" and choose UTF-8. The exact interface depends on your software version.

To have AI write formulas or work on an existing spreadsheet, see [Using AI to write Excel formulas and handle spreadsheets](/en/blog/ai-excel-formulas).

## What if the output gets cut off or keeps failing midway?

With many rows, the output may be truncated partway. Work in batches: ask for 30 rows at a time and say "continue from row 31." If even basic requests fail often, rule out a problem with the service itself first. Check the [cdnping "is it down" page](/en/down) and the [API status page](/en/status), then decide whether to retry.

## If you want to use this long-term in coding tools

The prompting techniques above work in web chat and in the API alike. If you later start using tools such as Claude Code or Codex for batch spreadsheet work and scripts, take a look at AGI Plan. It is a multi-provider LLM aggregation gateway: one monthly subscription includes several capability groups, you pay in RMB with no overseas credit card needed, and tools like Claude Code and Codex only need one endpoint URL changed. A disclosure: AGI Plan is a commercial partner of cdnping. The site itself states that it is not an officially authorized channel, and some models are marked "overseas only." See the [models page](https://agiplan.dev/models) for current details. For getting started, see [AGI Plan beginner setup](https://agiplan.dev/startup). If you aren't coding, the free web version of an AI is enough to practice what this post covers; to decide whether to pay, see [Is the free tier of AI enough?](/en/blog/free-ai-vs-paid-enough)

## Next steps

1. Pick a real piece of content you have on hand (meeting notes, a bill, a to-do list) and try the table template above once.
2. If the columns come out wrong, don't start over. Just add "change the columns to ..., keep everything else the same."
3. Choose the format once you know the use: a Markdown table for reading, CSV or tab-separated text for Excel, JSON for programs.
4. Save the prompt that works as your own template and swap in new content next time.
