> For the complete documentation index, see [llms.txt](https://docs.acpt.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.acpt.io/meta-fields/field-types/table-field.md).

# Table field

The table field allows the user to create and manipulate an HTML table.

### General settings

Click on the button labeled "Create table" to create a new one, and a popup appears:

<figure><img src="https://3235524095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fiyf0tSKPgXiyoQ3zV3I6%2Fuploads%2Fgit-blob-7284fd4cf20a2f08026a4ba13f7261f0efa58e4a%2FCompany-Settings-%E2%80%B9-Localhost-%E2%80%94-WordPress-10-28-2024_03_03_PM%20(2).png?alt=media" alt=""><figcaption></figcaption></figure>

The popup shows you the table's general settings:

* **columns** - the number of columns
* **rows** - the number of rows
* **layout** - choose between horizontal and vertical
* **alignment** - the cells' global text alignment
* **border-style** - the cells' global border styles
* **text color** - the cells' global text color
* **background-color** - the background color of the cells. If you want to create a zebra effect, choose two different main and alt colors.

At the bottom you'll also find two flags:

* **add header** - if you want a `<thead>`
* **add footer** - if you want a `<tfoot>`

Click on Create once you're done.

### Editing a cell

Double-click on a cell to edit it.

When editing a cell, you can navigate the other table cells by pressing the TAB key.

### Adding and removing rows and columns

To add a row, click on the "+" icon on the left side of the table (where you see the numbers).

<figure><img src="https://3235524095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fiyf0tSKPgXiyoQ3zV3I6%2Fuploads%2Fgit-blob-c52c471544d1ada55a83564a955dd1b650fe6c5f%2Fadd%20rows.png?alt=media" alt=""><figcaption></figcaption></figure>

To add a column, click the "+" icon at the top of the table (where you see the letters).

<figure><img src="https://3235524095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fiyf0tSKPgXiyoQ3zV3I6%2Fuploads%2Fgit-blob-fed868856a708e3d45fdf5b2d0032f8e9e0d62f8%2Fadd%20columns.png?alt=media" alt=""><figcaption></figcaption></figure>

To delete a row, click the "-" icon at the very end of the row.

<figure><img src="https://3235524095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fiyf0tSKPgXiyoQ3zV3I6%2Fuploads%2Fgit-blob-fcf833c17721a209e5578b9709e2b02e85dc5b21%2Fdelete-rows.png?alt=media" alt=""><figcaption></figcaption></figure>

Finally, to delete a column, click the "-" icon on top of it.

<figure><img src="https://3235524095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fiyf0tSKPgXiyoQ3zV3I6%2Fuploads%2Fgit-blob-fed868856a708e3d45fdf5b2d0032f8e9e0d62f8%2Fadd%20columns.png?alt=media" alt=""><figcaption></figcaption></figure>

### Custom Cell settings

You can override all the cell single properties.

Right-click on a cell and a contextual menu appears:

<figure><img src="https://3235524095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fiyf0tSKPgXiyoQ3zV3I6%2Fuploads%2Fgit-blob-918d5bfa519bf82bf885232f19951a29d2f57506%2FCompany-Settings-%E2%80%B9-Localhost-%E2%80%94-WordPress-10-28-2024_03_02_PM%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

### Save as template

Every table can be saved as a reusable template.

Just click on the **Save as template** button and a popup appears:

<figure><img src="https://3235524095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fiyf0tSKPgXiyoQ3zV3I6%2Fuploads%2Fgit-blob-208f3efda05b5a78de942932f16ec0165842598a%2FCompany-Settings-%E2%80%B9-Localhost-%E2%80%94-WordPress-10-28-2024_03_03_PM.png?alt=media" alt=""><figcaption></figcaption></figure>

Select the name and save.

### Import template

If you have one or more saved templates, you can always import them.

Click on the **Import template** button, and a pop-up appears:

<figure><img src="https://3235524095-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fiyf0tSKPgXiyoQ3zV3I6%2Fuploads%2Fgit-blob-02829cb6aa523f8b8716b49056b0c4713c4242ab%2FCompany-Settings-%E2%80%B9-Localhost-%E2%80%94-WordPress-10-28-2024_03_03_PM%20(1).png?alt=media" alt=""><figcaption></figcaption></figure>

Select the template, and this will be automatically applied to the field.

### Arithmetic calculations

To evaluate a mathematical expression, use the following syntax:

```
=(EXPR)
```

You can perform simple operations like `=(23+56)` or reference other cell values.\
Both individual cells (e.g., `A1, A2, A4`) and cell ranges (e.g., `A1:A4`) are supported.

The following operators are available:

| Operator   | Description                                  | Examples                                   |
| ---------- | -------------------------------------------- | ------------------------------------------ |
| **SUM**    | Addition or subtraction                      | `=(SUM(A1,A2,A4))` • `=(SUM(A1:A4))`       |
| **MULT**   | Multiplication or division                   | `=(MULT(A1,A2,A4))` • `=(MULT(A1:A4))`     |
| **MIN**    | Returns the minimum value                    | `=(MIN(A1,A2,A4))` • `=(MIN(A1:A4))`       |
| **MAX**    | Returns the maximum value                    | `=(MAX(A1,A2,A4))` • `=(MAX(A1:A4))`       |
| **AVG**    | Calculates the average                       | `=(AVG(A1,A2,A4))` • `=(AVG(A1:A4))`       |
| **ROUND**  | Rounds a number                              | `=(ROUND(A1, 2))`                          |
| **POW**    | Raises a number to a power                   | `=(POW(A1, 2))`                            |
| **PERC**   | Calculates a percentage                      | `=(PERC(A1, 56))`                          |
| **SQRT**   | Returns the square root of a number          | `=(SQRT(A1))`                              |
| **ABS**    | Returns the absolute value of a number       | `=(ABS(A1))`                               |
| **MOD**    | Returns the remainder of a division          | `=(MOD(A1, 3))`                            |
| **MEDIAN** | Returns the median value                     | `=(MEDIAN(A1,A2,A4))` • `=(MEDIAN(A1:A4))` |
| **COUNT**  | Counts the numeric cells among the arguments | `=(COUNT(A1,A2,A4))` • `=(COUNT(A1:A4))`   |

### Import data from a Google Sheet

Click on the Import Google Sheet button, and a pop-up appears.

Then, paste the [Google Spreadsheet ID](https://developers.google.com/workspace/sheets/api/guides/concepts?hl=it#sheet), select the Sheet, and choose the format.

The data will be automatically appended to the table.

{% hint style="warning" %}
The Google Sheet MUST be public.
{% endhint %}

{% hint style="info" %}
If the number of items per row doesn't match the number of columns, an error will be thrown.
{% endhint %}

### Import data from a CSV

Click on the **Import CSV** button, and a pop-up appears.

Then, select your CSV file, and the data will be appended to the table.

{% hint style="info" %}
If the number of items per row doesn't match the number of columns, an error will be thrown.
{% endhint %}

### Pagination and sorting

If you want your table to support sorting and pagination, open the [Advanced Options panel](/meta-fields/the-meta-fields-manager/advanced-options-fields-settings.md), set the number of items per page, and enable the sortable option.
