> ## Documentation Index
> Fetch the complete documentation index at: https://docs.affinda.com/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.affinda.com/feedback

```json
{
  "path": "/academy/table-editor",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Table Editor

> Use the Affinda table editor to add, remove, and correct rows and columns in extracted tables before approving documents for downstream export.

## Purpose

Extracting data from tables can be slow and error-prone. Affinda’s table editor makes this process fast and reliable by letting you validate and correct tables using two editing modes: **Grid** (for clean, column-based tables) and **Freeform** (for irregular or nested layouts).

This tutorial explains how to review and adjust tables extracted by Affinda — whether you are:

* **Improving model performance** by confirming correctly extracted tables (adding them to model memory), or
* Reviewing documents as part of **ongoing processing workflows**.

<iframe className="w-full aspect-video rounded-xl" src="https://www.youtube.com/embed/_xR3uwOjDO4?start=1" title="YouTube video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen />

## Grid vs Freeform

Affinda automatically selects a table mode when a table is detected or drawn, but you can switch at any time using the **Grid / Freeform toggle** at the top of the editor.

### **Grid**

Use **Grid** for classic, well-structured tables where data falls neatly into rows and columns.

* Best for: invoices, order lines, financial tables, spreadsheets
* You adjust **row lines** and **column lines** directly on the document
* The table output updates **immediately** as you move lines — *no Fill down used in Grid mode*

### **Freeform**

Use **Freeform** when the table cannot be cleanly separated by vertical columns — for example, when fields are stacked (e.g. a code on one line and a description beneath it).

* Best for: irregular layouts, nested blocks, multi-line item structures
* You annotate **one complete example row**
* Then apply **Fill down** to propagate that row’s logic to all remaining rows

## Step-by-Step

<Steps>
  <Step title="Create a new table (if required)">
    In most cases, Affinda will automatically predict a table that exists in the document.\
    If not — or if you delete the prediction — draw a box around the table area (excluding the header) and select the correct table field.

    Affinda will immediately detect rows and prefill values based on the table type.
  </Step>

  <Step title="Edit table boundary">
    Click the table boundary and drag to adjust it if needed.\
    This ensures all rows and fields are included before you begin refining the table.

    The boundary can be adjusted in both Grid and Freeform modes.
  </Step>

  <Step title="Set and adjust table rows">
    Rows are edited the same way in **both** Grid and Freeform modes.

    **Adjusting row lines**

    Drag the horizontal row lines up or down so each row contains exactly one line item.

    **Add / remove rows**

    * Hover on the **left side** of the table to add a new row (a **+** button appears)
    * Click the **✕** next to a row to delete it

    **Tick / Untick**

    Tick marks on the left control whether a row is included in the table output.

    * **Ticked** rows → included
    * **Unticked** rows → ignored
  </Step>

  <Step title="Grid mode: Adjust columns and assign fields">
    In Grid mode, drag **vertical column lines** at the top of the table to match the document’s structure.

    Once the columns are aligned:

    * Click the **column header dropdown**
    * Select the correct field (e.g. Description, Quantity, PO Number, Total)

    The table output updates instantly as you adjust the grid — no Fill down is needed in Grid mode.
  </Step>

  <Step title="Freeform: Annotate the first row and Fill down">
    In Freeform mode, annotate a **single complete example row** by drawing boxes around each field exactly as it appears (e.g. a stacked “CT number + description” pair).

    When the first row looks correct:

    * Click **Fill down** to apply its structure to the remaining rows
    * If for some instance Fill down doesn’t work correctly for a later row, correct that row manually and apply Fill down again from that row downward

    <Tip>
      ### Tip: Set rows correctly before filling down

      Fill down relies heavily on accurate row boundaries. The cleaner the row structure, the better the propagation.
    </Tip>
  </Step>

  <Step title="Freeform: Repeat corrections (if required)">
    Most tables will be correct after the first Fill down or first Grid adjustment.

    If not:

    * Fix the next incorrect row
    * In Freeform mode, apply Fill down again from that row
    * Continue until all rows look accurate

    This top-to-bottom workflow gives the best results.
  </Step>
</Steps>
