Skip to content

There are three ways you can insert tables in Overleaf:

  1. Using the Insert Table button in the editor toolbar.
  2. Copying and pasting a table from another document while using Visual Editor.
  3. Writing the LaTeX code for the table in Code Editor.

If you’re a confident LaTeX user, you’ll find you get the most flexible, customizable formatting using option 3. If you’re new to LaTeX, using the toolbar in Visual Editor (option 1) is a great way to get started. And you can switch between Visual Editor and Code Editor to see the code behind the table.

This page focuses on option 1 but we also have detailed guidance on how to create tables using LaTeX.

Using Insert Table to create a table in your project

Please note: this feature is new and more functionality is planned, so keep checking back to this page to see what else is added. We’d also love your feedback on it, which you can provide in this survey.

  1. Switch to Visual Editor using the toggle above the editor pane (or remain in Code Editor if you are comfortable editing LaTeX code).
  2. Select the Insert table button ("") on the toolbar.
  3. ""

    • If you can’t see the Insert table button, use the three-dot menu or enlarge the editor window by extending (dragging) the slider until the Insert table button is visible:
    • ""

  4. Using the pop-up selector, highlight the required number of rows and columns, then click the bottom-right selected cell to insert an empty table. Here, we insert a blank 3 x 3 table:
  5. ""

    This short video clip shows a 3 × 3 table being added to a project.

  6. The empty table is now ready for you to edit. You can do this in Code Editor if you’re comfortable with LaTeX table code, or continue with Visual Editor, which provides additional table formatting functionality that’s currently unavailable in Code Editor.

How to 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.

""

Some menu icons remain grayed 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.

  • "" Delete or move the table caption.
  • "" Change the table borders.
  • ""Set the alignment of a column or merged cell.
  • "" Merge cells in a row.
  • "" Delete rows or columns.
  • ""Insert rows and columns.
  • ""Delete the entire table. To restore an accidentally deleted table, use the Undo button ("") on the toolbar located above the Visual Editor and Code Editor.
  • ""Get help.
  • ""Send feedback to Overleaf.

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{...} for bold text.
    • use \textit{...} for italic text.
    • use \textbf{... \textit{...}...} for text in bold italic.

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}}

""

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.

""

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.
  2. ""

  3. The LaTeX \caption command is displayed.
  4. Add your preferred caption between the braces {...}
  5. ""

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

  • Select any table cell to display the table editor menu.
  • 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.
    • ""

  • Note: The caption dropdown is disabled if the tabular environment is not directly inside a table environment. This is demonstrated by the following example in which the tabular environment is directly inside a center environment.
  • \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.

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

""

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 two user-selectable options:

  • All borders: All cells have a border.
  • No borders: No cells have a border.
  • ""

A table inserted from the toolbar starts with the No borders option. If you add borders 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 {...}.
  4. ""

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.

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) whose alignment you want to change.
  2. The alignment icon ("") 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:
  5. ""

How to change the alignment of a table cell

How to merge (or unmerge) table cells

Table cells can be merged, horizontally, within a table row, but not vertically within a table column.

Merging two or more cells in a table row

  1. Select the cells you want to merge.
  2. Select the Merge cells icon ("") to merge the cells.
  3. Optionally, you can change the alignment of the merged cells.

Unmerging two or more merged cells

  1. Select the merged cell.
  2. Select the Merge cells icon ("") to unmerge the cells.

The following video demonstrates merging three cells in a table row, changing alignment of the merged cell and unmerging the cell content.

  • Note: All content contained in the merged cell is placed in the first cell of the unmerged set.

How to delete a table row or column

  1. Select the rows or columns you want to delete.
  2. Select the Delete row or column icon ("") to delete the selected rows or columns.

How to add new rows or columns

The Insert button ("") lets you add one or more new rows or columns before or after a selected location.

If you want to insert m rows and n columns, select an m × n group of cells covering the locations where you want to insert those rows and columns.

Example: In the following screenshot, a 3 × 2 group of cells straddling 3 rows and 2 columns has been selected.

    ""

  • Selecting "" provides the following options:
  • ""

  • You can now insert any of the following:
    • 2 columns to the left of column 1
    • 2 columns to the right of column 2
    • 3 rows above row 1
    • 3 rows below row 3

FAQs about tables in Visual Editor

What if I want more formatting options?

There are many ways to configure tables that aren’t yet possible using Visual Editor generated tables. For more complex formatting you’ll need to use LaTeX code. Read our detailed guidance on how to create tables using LaTeX.

Can the Visual Editor preview tables I create using the Code Editor?

It depends on the table and its code, but the Visual Editor will try to preview as much as possible. Complex tables, such as those created using LaTeX packages, journal article templates, or custom user commands (macros), may be partially, or entirely displayed as LaTeX code when viewed in the Visual Editor.

If the table cannot be previewed, e.g., it contains LaTeX markup errors, you will see the following message:

""

Does Visual Editor support the booktabs package?

Visual Editor has some support for horizontal rules provided by the booktabs package. The following example uses the booktabs package commands \toprule, \midrule, and \bottomrule.

\documentclass{article}
\usepackage{booktabs}
\usepackage{hologo} % for the XeTeX logo
\begin{document}
\begin{table}
\begin{tabular}{lcc}
\toprule 
    \TeX{} engine&Year released&Native UTF-8\\
\midrule 
    pdf\TeX&1996&No\\ 
    \hologo{XeTeX}&2004&Yes\\ 
    Lua\TeX&2007&Yes\\
    LuaHB\TeX&2019&Yes\\ 
\bottomrule
\end{tabular}
\end{table}
\end{document}

 Open this example in Overleaf and switch to Visual Editor.

Open the code above, then switch to Visual Editor to see the following preview:

""

Does Visual Editor preview borders applied using LaTeX code?

Borders created within the tabular environment using | in the table’s specification, or \hline in the table body will be previewed in Visual Editor, as demonstrated by the next example.

\documentclass{article}
\begin{document}
\begin{table}
\centering
\begin{tabular}{c|c|c}
         R1C1&R1C2& \\
         \hline
         R2C1&  & \\
         \hline
         R3C1 &R3C2 &R3C3\\
\end{tabular}
    \caption{This is my table caption.}
    \label{tab:mynewtable}
\end{table}
\end{document}

 Open this example in Overleaf and switch to Visual Editor.

Open the code above, then switch to Visual Editor to see the following preview:

""

Overleaf guides

LaTeX Basics

Mathematics

Figures and tables

References and Citations

Languages

Document structure

Formatting

Fonts

Presentations

Commands

Field specific

Class files

Advanced TeX/LaTeX