Let
X

How to Make a Table in LaTeX

Updated June 2026

To make a table in LaTeX, use the tabular environment: \begin{tabular}{|c|c|} defines two centered columns with vertical borders, rows are separated by \\, columns by &, and \hline draws horizontal lines. Wrap it in a table environment to add a caption and label. LetX previews the result instantly as you type.

Step by step

  1. 1

    Open tabular

    Use \begin{tabular}{|l|c|r|} — l/c/r set left, center, right alignment per column; | adds vertical lines.

  2. 2

    Add rows

    Separate cells with & and end each row with \\.

  3. 3

    Add lines

    Use \hline between rows for horizontal borders.

  4. 4

    Add a caption

    Wrap in a table environment with \caption{...} and \label{tab:...}.

  5. 5

    Compile

    Compile to PDF to see the formatted table. LetX renders it in 1–2 seconds.

Example

\begin{table}[h]
  \centering
  \begin{tabular}{|l|c|r|}
    \hline
    Item & Qty & Price \\
    \hline
    Pen & 3 & 1.50 \\
    Notebook & 1 & 4.00 \\
    \hline
  \end{tabular}
  \caption{Order summary.}
  \label{tab:order}
\end{table}

For professional tables, the booktabs package (\toprule, \midrule,\bottomrule) looks far better than vertical lines and is the academic standard.

Frequently asked questions

How do I merge cells in a LaTeX table?

Use \multicolumn{2}{c}{text} to span columns, and the multirow package with \multirow{2}{*}{text} to span rows.

How do I make a table wider than the page?

Use the tabularx package with \begin{tabularx}{\textwidth}{...} and an X column type to auto-fit, or rotate it with the rotating package.

What is the best LaTeX table style?

The booktabs package is the academic standard: use \toprule, \midrule, \bottomrule and avoid vertical lines for clean, readable tables.

Try this in LetX now

Open the editor, paste the example, and compile in 1–2 seconds — free, in your browser.

Start Writing Free