Tables in LaTeX

Create tables with the tabular environment. Use booktabs for publication-quality styling.

Quick Answer

latex
\begin{tabular}{l c r}
  Name   & Score & Grade \\
  \hline
  Alice  & 95    & A     \\
  Bob    & 82    & B     \\
\end{tabular}

Column Specifiers

SpecifierMeaning
lLeft-aligned column
cCentered column
rRight-aligned column
p{3cm}Fixed-width paragraph column
|Vertical line between columns
@{}Remove inter-column spacing

Writing your thesis in LaTeX?

MonsterWriter's LaTeX Workspace gives you real-time PDF preview with no compile limits — at a fraction of Overleaf's price. Works just like Overleaf, costs 11× less.

Try MonsterWriter free

Publication-Quality with booktabs

The booktabs package replaces \hline with professional horizontal rules. Vertical lines are intentionally omitted.

latex
\usepackage{booktabs}

\begin{tabular}{lcc}
  \toprule
  Method     & Accuracy & Time (s) \\
  \midrule
  Baseline   & 72.3%   & 1.2      \\
  Our model  & 89.1%   & 2.7      \\
  \bottomrule
\end{tabular}

Floating Table with Caption

latex
\begin{table}[htbp]
  \centering
  \caption{Comparison of methods}
  \label{tab:comparison}
  \begin{tabular}{lcc}
    \toprule
    Method & Accuracy & Time \\
    \midrule
    A & 72% & 1.2s \\
    B & 89% & 2.7s \\
    \bottomrule
  \end{tabular}
\end{table}

% Reference it:
As shown in Table~\ref{tab:comparison}, ...

Spanning Multiple Columns

latex
\begin{tabular}{lcc}
  \toprule
  \multicolumn{3}{c}{Results Summary} \\
  \midrule
  Name & Score & Grade \\
  \midrule
  Alice & 95 & A \\
  \bottomrule
\end{tabular}

Spanning Multiple Rows

latex
\usepackage{multirow}

\begin{tabular}{llc}
  \toprule
  Group & Item & Value \\
  \midrule
  \multirow{2}{*}{Group A} & Item 1 & 10 \\
                            & Item 2 & 20 \\
  \bottomrule
\end{tabular}

Related Topics