Generating and inserting tables

This page explains how to generate, edit, and insert LaTeX tables in Overleaf. In practice, there are four options to create tables:

  1. Using the Insert Table button in the Visual Editor (or Code 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.

  4. Using Overleaf’s LaTeX table generator.

If you’re a confident LaTeX user you'll likely use option 3, which offers the most flexibility for generating tables. In that case, our detailed guidance on how to create tables using LaTeX will serve you well.

If you’re new to LaTeX, both the AI-powered LaTeX table generator and the toolbar in Visual Editor (option 1) provide excellent starting points. This page will focus on using the Visual Editor toolbar, from which you can switch between Visual Editor and Code Editor to observe the underlying table code.

Using Insert Table to generate a table

  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.

  1. Click on Select size (see AI Table Generator to learn how to Insert from a text prompt or image)

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

The Insert Table pop-up selector

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

  1. 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.

FAQs about tables

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:

"Sorry, your table can't be displayed at the moment" 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:

Preview for tables
Does Visual Editor preview borders applied using LaTeX\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:

Preview of table

Last updated

Was this helpful?