# Edit or customize an inserted table

## Get to know the table editor menu

In **Visual Editor**, select one or more of your table’s cells to display the table editor menu:

<figure><img src="/files/RgOpagHPSQt9CSVBkMsS" alt="Image showing the insert table menu"><figcaption></figcaption></figure>

Some menu icons remain greyed out (inactive) until you select a suitable range of cells required to complete those actions. For example, you can only merge cells after you’ve selected two or more cells in a row.

Here’s a short summary of the icons and drop-down menus.

* ![](/files/YangbbxGXwKWedwEsWuk) Delete or move the table caption.
* ![](/files/0TmlNV1erZow65uSjnKk) Change the table borders.
* ![](/files/2j1qBPmAlFHRVESgNfVe) Set the alignment of a column or merged cell.
* ![](/files/EUPmH4Kb0ogy2uiwek5o) Adjust column width.
* ![](/files/YuO19PGEmJICM64KLZUi) Merge cells in a row.
* ![](/files/WrSGzHps9RvhfYaHKika) Delete rows or columns.
* ![](/files/5ofcmCDSEh35nrB0RBqb) Insert rows and columns.
* ![](/files/w4kVGwwVQ38FQCxGupG3) Delete the entire table. To restore an accidentally deleted table, use the **Undo** button (![](/files/J2vsiWRRFUNmCKSsnvBl)) on the toolbar located above the Visual Editor and Code Editor.
* ![](/files/dL3vdtQZ4IplLcbF15Pm) Get help.

## How to edit table cells

There are two ways to start editing a cell:

1. Double-click on the cell you want to edit.
2. Use the tab or arrow keys to navigate to a particular cell, then press **Enter**.

Here are some tips for editing cell content using **Visual Editor**:

* Use LaTeX commands, not the toolbar, to apply bold or italic styles to cell text:
  * use [`\textbf{...}`](https://www.overleaf.com/learn/latex/Bold%2C_italics_and_underlining%23Bold_text#Bold_text) for **bold** text.
  * use [`\textit{...}`](https://www.overleaf.com/learn/latex/Bold%2C_italics_and_underlining#Italicized_text) for *italic* text.
  * use `\textbf{... \textit{...}...}` for text in ***bold italic***.
* Cells can contain [inline mathematics](https://learn.overleaf.com/learn/Mathematical_expressions#Inline_math_mode) via `\( ... \)`.

**Visual Editor** will preview the styled text and inline math.

### **Example: styled text and math in table cells**

The next screenshot shows **Visual Editor** previewing the following cell content:

* `\(\sqrt{a^2+b^2}\)`
* `\textbf{bold}, \textit{italic}, \textbf{\textit{bold italic}}`

<figure><img src="/files/wUiOKl4osPxYiW5ABvKV" alt="Visual editor preview of a table" width="375"><figcaption></figcaption></figure>

## How to select one or more columns or rows

1. Use the row or column selectors to select a particular row or column.
2. Hold down the Shift key to select multiple rows or columns.

<figure><img src="/files/CeKs2yO0ukxprNfMlTuH" alt="Image that highlights column selectors and row selectors" width="375"><figcaption><p>""</p></figcaption></figure>

You can also select multiple rows or columns by clicking on (selecting) a cell and dragging the selection (mouse) pointer.

## How to change the table caption

### To edit the caption text

1. Click on the default caption text, which is the word **Caption.**

<figure><img src="/files/MscG36qoI6wUj6kYPxJS" alt="Image that highlights the table caption" width="375"><figcaption><p>""</p></figcaption></figure>

2. The LaTeX `\caption` command is displayed.
3. Add your preferred caption between the braces `{...}`

<figure><img src="/files/Lgc0B90pzIlIUM17pzDD" alt="Image that displays the editing view of the table caption" width="375"><figcaption><p>""</p></figcaption></figure>

### To remove the caption or place it above or below the table

1. Select any table cell to display the table editor menu.
2. From the caption drop-down menu, select your preferred option:
   * **No caption**: Remove it.
   * **Caption above**: Place the caption above the table.
   * **Caption below**: Place the caption below the table.

<figure><img src="/files/K7T7fC2n1YuwWmjOtBcN" alt="The caption menu for the table" width="375"><figcaption></figcaption></figure>

{% hint style="info" %}
The caption drop-down is disabled if the [`tabular`](https://www.overleaf.com/learn/latex/Tables#Creating_a_simple_table_in_LaTeX) [environment](https://learn.overleaf.com/learn/Environments) is not directly inside a [`table` environment](https://www.overleaf.com/learn/latex/Tables#Positioning_tables). This is demonstrated by the following example in which the `tabular` environment is directly inside a `center` environment.
{% endhint %}

```latex
\documentclass{article}
\usepackage{hologo} % for the XeTeX logo
\begin{document}
\begin{center}
\begin{tabular}{lcc}
\hline
    \TeX{} engine&Year released&Native UTF-8\\
\hline
    pdf\TeX&1996&No\\ 
    \hologo{XeTeX}&2004&Yes\\ 
    Lua\TeX&2007&Yes\\
    LuaHB\TeX&2019&Yes\\ 
    \hline
    \end{tabular}
    \end{center}
    \end{document}
```

[Open this example in Overleaf and switch to Visual Editor.](https://www.overleaf.com/docs?engine=pdflatex\&snip_name=A+tabular+not+immediately+inside+a+table\&snip=%5Cdocumentclass%7Barticle%7D%0A%5Cusepackage%7Bhologo%7D+%25+for+the+XeTeX+logo%0A%5Cbegin%7Bdocument%7D%0A%5Cbegin%7Bcenter%7D%0A%5Cbegin%7Btabular%7D%7Blcc%7D%0A%5Chline%0A++++%5CTeX%7B%7D+engine%26Year+released%26Native+UTF-8%5C%5C%0A%5Chline%0A++++pdf%5CTeX%261996%26No%5C%5C+%0A++++%5Chologo%7BXeTeX%7D%262004%26Yes%5C%5C+%0A++++Lua%5CTeX%262007%26Yes%5C%5C%0A++++LuaHB%5CTeX%262019%26Yes%5C%5C+%0A%5Chline%0A%5Cend%7Btabular%7D%0A%5Cend%7Bcenter%7D%0A%5Cend%7Bdocument%7D)

If you open the code above in Overleaf then switch to Visual Editor, you’ll see the caption drop-down is greyed out (disabled):

<figure><img src="/files/60il9jjzlDGYfy421Nwb" alt="Greyed-out caption dropdown" width="375"><figcaption><p>""</p></figcaption></figure>

## How to add borders to table cells

At the moment, **Visual Editor** provides basic support for borders, accessible from the borders drop-down menu which currently has three user-selectable options:

* **All borders**: All cells have a border.
* **No borders**: No cells have a border.
* **Booktabs**: A three-lined table.

<figure><img src="/files/u3RLNn0d2hTOuh2ltRnq" alt="Menu options for border cells" width="199"><figcaption></figcaption></figure>

A table inserted from the toolbar starts with the **No borders** option. If you [add borders using LaTeX code](#does-visual-editor-preview-borders-applied-using-latex-code), the button will display **Custom borders**.

## How to change the table’s label

1. Click on the default label text `tab:my_label.`
2. The LaTeX `\label` command is displayed.
3. Add your preferred label between the braces {...}.

<figure><img src="/files/NBoBqfnOUJk6pGGsQizF" alt="Adding labels to tables" width="375"><figcaption></figcaption></figure>

The label text is an identifier used to reference this table elsewhere in your document. You can read more about using labels in our [article on cross-referencing](/writing-and-editing/inserting-images.md#labels-and-cross-references).

## How to change the alignment of a table column

Table columns can be right-, left-, or center-aligned. Follow these steps to change a column’s alignment:

1. [Select the column(s)](#how-to-select-one-or-more-columns-or-rows) whose alignment you want to change.
2. The alignment icon (![](/files/2j1qBPmAlFHRVESgNfVe)) becomes active.
3. Select the drop-down menu, then choose the preferred alignment: left, centered, or right.
4. The following screenshot shows how to right-align all cells in column 1 of a table:

<figure><img src="/files/gozOySLwZmOcfdc1ej1F" alt="Selecting right-alignment for cells in a table" width="375"><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.overleaf.com/writing-and-editing/generating-and-inserting-tables/edit-or-customize-an-inserted-table.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
