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:
Using the Insert Table button in the Visual Editor (or Code Editor) toolbar
Pasting tables into your project from another document while using Visual Editor
Writing the LaTeX code for the table in Code Editor
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
Switch to Visual Editor using the toggle above the editor pane (or remain in Code Editor if you are comfortable editing LaTeX code).
Select the Insert table button on the toolbar:


Click on Select size (see AI Table Generator to learn how to Insert from a text prompt or image).
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 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.
\begin{table}
\centering
\begin{tabular}{ccc}
& & \\
& & \\
& & \\
\end{tabular}
\caption{Caption}
\label{tab:placeholder}
\end{table}

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:

Does the 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:


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:


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?