Underleaf Logo
Underleaf
PricingBlogInstall for OverleafStart for free

Learn LaTeX

Text Formatting

  • Bold Text in LaTeX
  • Italics in LaTeX
  • Subscript and Superscript
  • Greek Letters and Symbols

How to Create Tables in LaTeX

Tables are essential for presenting data in a structured format. This guide covers everything you need to know about creating and formatting tables in LaTeX, from basic structures to advanced formatting options.

Basic Table Structure

The basic table structure in LaTeX uses the tabular environment:

LeftCenterRight
123
456

LaTeX code:

\begin{tabular}{|l|c|r|} \hline Left & Center & Right \\ \hline 1 & 2 & 3 \\ 4 & 5 & 6 \\ \hline \end{tabular}

The {|l|c|r|} specifies three columns with vertical lines (|) and different alignments: left (l), center (c), and right (r).

Table Environment

For floating tables with captions, use the table environment:

Sample Table

Header 1Header 2
Value 1Value 2
Value 3Value 4

LaTeX code:

\begin{table}[h] \centering \caption{Sample Table} \begin{tabular}{cc} Header 1 & Header 2 \\ \hline Value 1 & Value 2 \\ Value 3 & Value 4 \end{tabular} \end{table}

Multicolumn and Multirow

Create spanning cells using multicolumn and multirow commands:

Title Spanning Three Columns
Col 1Col 2Col 3
123

LaTeX code:

\begin{tabular}{|c|c|c|} \hline \multicolumn{3}{|c|}{Title Spanning Three Columns} \\ \hline Col 1 & Col 2 & Col 3 \\ \hline 1 & 2 & 3 \\ \hline \end{tabular}

Professional Tables with booktabs

The booktabs package provides commands for creating professional-quality tables:

ItemQuantityPrice
Apple5$0.99
Orange3$0.75
Banana4$0.50

LaTeX code:

\begin{tabular}{lrr} \toprule Item & Quantity & Price \\ \midrule Apple & 5 & \$0.99 \\ Orange & 3 & \$0.75 \\ Banana & 4 & \$0.50 \\ \bottomrule \end{tabular}

Best Practices

  • Use the booktabs package for professional-looking tables without vertical lines
  • Avoid using too many vertical lines as they can make tables harder to read
  • Use consistent spacing and alignment throughout your document
  • Consider using the tabularx package for tables that need to fit a specific width
  • Use the table environment for floating tables with captions
Underleaf Logo
Underleaf

Empowering students and researchers with AI-powered tools for academic writing.

Company

PricingGuideBlogLearn

© 2025 Underleaf. All rights reserved.