For the complete documentation index, see llms.txt. This page is also available as Markdown.

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. Pasting tables into your project 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. You may also want to enroll in the free, self-paced course "Structuring and Formatting Essentials" to learn more about creating tables with Overleaf.

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 Insert table button on the toolbar:

Location of the Insert Table button
3

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

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:

The Insert Table pop-up selector
5

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.

Empty 3x3 table
\begin{table}
    \centering
    \begin{tabular}{ccc}
         &  & \\
         &  & \\
         &  & \\
    \end{tabular}
    \caption{Caption}
    \label{tab:placeholder}
\end{table}

To learn more about how to incorporate the AI Table Generator in your writing, enroll in our free, self-paced course "Leveraging Overleaf AI".

FAQs about tables

Can the Visual Editor preview tables created in 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 the 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.

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 with borders
Does the 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.

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 booktabs table
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.

Learn More

Last updated

Was this helpful?