> For the complete documentation index, see [llms.txt](https://docs.docbits.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.docbits.com/administration-and-setup/setup/document-training/training-line-fields-table-training/defining-tables-and-columns.md).

# Defining Tables and Columns

If a table is not recognized completely, use table training to define its area and columns. These examples use a fictional invoice. The illustrated training areas are unsaved drafts.

## Open table training

Open the document in **Field Validation**, then open **Table Extraction**. The document appears on the left and the training controls on the right.

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-d641963f9668585ccc57cd2674b27c2345aaf0c3%2Fs150-define_tables_and_columns_1.png?alt=media" alt="English interface for defining tables and columns."><figcaption><p>English interface for defining tables and columns.</p></figcaption></figure>

## Enable training mode

Turn on **Training Mode** to make the table-selection and column tools available.

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-bc3a5751ef5fdaf301ed1f0664db00ffc86c15e1%2Fs150-define_tables_and_columns_2.png?alt=media" alt="Table training with training mode enabled."><figcaption><p>Table training with training mode enabled.</p></figcaption></figure>

The toolbar includes automatic table detection. Check its result against the document before defining columns. This image shows the available tools; it does not demonstrate a completed automatic detection.

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-bc3a5751ef5fdaf301ed1f0664db00ffc86c15e1%2Fs150-define_tables_and_columns_2.png?alt=media" alt="Table-training tools including automatic detection."><figcaption><p>Table-training tools including automatic detection.</p></figcaption></figure>

## Select the table area

For a manual selection, choose the pencil tool and drag a rectangle around the column headings and line items. Exclude totals below the table.

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-2f245a1c6f956c2b37ecbbfc49272dc503d25b83%2Fs150-define_tables_and_columns_4.png?alt=media" alt="Unsaved table area around the fictional invoice&#x27;s line items."><figcaption><p>Unsaved table area around the fictional invoice's line items.</p></figcaption></figure>

## Position the column separators

Choose the column tool, then place or drag vertical separators between the actual columns.

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-b949388d9be14e1206e8e81b50a429f5e64b260a%2Fs150-define_tables_and_columns_5.png?alt=media" alt="Table area in edit mode with vertical column separators."><figcaption><p>Table area in edit mode with vertical column separators.</p></figcaption></figure>

Check the separation of item, description, quantity, unit price and amount. The separators in this example follow the five columns of the invoice.

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-56ac694938123480f001a256db78c40422e3a4c3%2Fs150-define_tables_and_columns_8.png?alt=media" alt="Table area with column separators positioned for the training draft."><figcaption><p>Table area with column separators positioned for the training draft.</p></figcaption></figure>

Review the complete area and column assignments before using **Save** or **Save Rules**.

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-56ac694938123480f001a256db78c40422e3a4c3%2Fs150-define_tables_and_columns_8.png?alt=media" alt="Table area and column separators in an unsaved training draft."><figcaption><p>Table area and column separators in an unsaved training draft.</p></figcaption></figure>

## Check the extracted values

Compare the extracted line items with the original document. This image shows the example invoice's already automatically extracted rows in validation. They are not a result of the unsaved training draft above.

<figure><img src="https://578966019-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FT2n2w4uDCJvv7CJ5zrdk%2Fuploads%2Fgit-blob-22f36a1b0f2b4c044ae876b7a42af0e509cc198c%2Fs150-define_tables_and_columns_10.png?alt=media" alt="Automatically extracted line items of the fictional invoice in validation."><figcaption><p>Automatically extracted line items of the fictional invoice in validation.</p></figcaption></figure>

Use **Save Rules** when you intend to retain the training, then test it with further documents from the same supplier. One example does not establish reliable extraction for other layouts.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.docbits.com/administration-and-setup/setup/document-training/training-line-fields-table-training/defining-tables-and-columns.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
