Underleaf Logo
Underleaf
BlogPricing
Log InTry Free

Learn LaTeX

Getting Started

  • What is LaTeX?
  • LaTeX for Beginners

LaTeX Tables Tutorial

Tables are essential for presenting structured data in academic and professional documents. This comprehensive tutorial walks you through creating tables in LaTeX, from basic structures to advanced formatting.

Part 1: Basic Table Structure

LaTeX tables use the tabular environment. The basic syntax defines columns and their alignment:

Column Alignment Options

SpecifierMeaningExample
lLeft-aligned columnText, names
cCenter-aligned columnHeaders, short text
rRight-aligned columnNumbers
|Vertical lineBorders
p{width}Fixed width with wrappingLong text

Part 2: Your First Table

Let's create a simple 3-column table:

Output:

NameAgeCity
Alice25New York
Bob30Los Angeles
Charlie28Chicago

Key syntax: Use & to separate columns and \\ to end rows.

Part 3: Adding Lines and Borders

Add horizontal lines with these commands:

  • \hline - Full horizontal line
  • \cline{i-j} - Line spanning columns i to j
  • | in column spec - Vertical line
LeftCenterRight
ABC
DEF

Part 4: Professional Tables with booktabs

For publication-quality tables, use the booktabs package. It provides cleaner horizontal rules without vertical lines:

ItemQtyPrice
Apples5$2.50
Oranges3$1.80
Bananas8$3.20
Total16$7.50

Part 5: Spanning Multiple Columns

Use \multicolumn to merge cells across columns:

Quarterly Sales Report
Q1Q2Q3
$100k$150k$200k

Part 6: Spanning Multiple Rows

Use the multirow package to merge cells vertically:

Use * for automatic width, or specify like 2cm.

Part 7: Floating Tables with Captions

Wrap your tabular in a table environment for positioning and captions:

Position options: h (here), t (top), b (bottom), p (separate page), ! (override)

Part 8: Fixed-Width Columns

For text that needs to wrap, use p{width}, m{width}, or b{width}:

SpecifierVertical Alignment
p{2cm}Top-aligned
m{2cm}Middle-aligned (requires array package)
b{2cm}Bottom-aligned (requires array package)

Part 9: Full-Width Tables with tabularx

The tabularx package creates tables that span a specific width:

The X column type expands to fill remaining space, distributing it equally among all X columns.

Part 10: Coloring Tables

Use the xcolor package with the table option for colored tables:

Complete Example: Publication-Ready Table

The siunitx package with S columns automatically aligns decimal points.

Best Practices Checklist

  • Use booktabs for professional-looking tables without vertical lines
  • Always include a caption and label for referenced tables
  • Right-align numerical data for easy comparison
  • Use siunitx for proper number formatting
  • Keep tables simple and avoid unnecessary borders
  • Use \centering instead of the center environment
  • Consider using tabularx for full-width tables

Try it free

Skip the syntax — let AI write it.

Snap a photo of an equation, a table, or full handwritten notes and Underleaf turns it into clean, compilable LaTeX in seconds. 10 free credits every month, no credit card required.

Convert your page
Handwritten notes converted into a typeset LaTeX document

LaTeX Tables Tutorial

Tables are essential for presenting structured data in academic and professional documents. This comprehensive tutorial walks you through creating tables in LaTeX, from basic structures to advanced formatting.

Part 1: Basic Table Structure

LaTeX tables use the tabular environment. The basic syntax defines columns and their alignment:

Column Alignment Options

SpecifierMeaningExample
lLeft-aligned columnText, names
cCenter-aligned columnHeaders, short text
rRight-aligned columnNumbers
|Vertical lineBorders
p{width}Fixed width with wrappingLong text

Part 2: Your First Table

Let's create a simple 3-column table:

Output:

NameAgeCity
Alice25New York
Bob30Los Angeles
Charlie28Chicago

Key syntax: Use & to separate columns and \\ to end rows.

Part 3: Adding Lines and Borders

Add horizontal lines with these commands:

  • \hline - Full horizontal line
  • \cline{i-j} - Line spanning columns i to j
  • | in column spec - Vertical line
LeftCenterRight
ABC
DEF

Part 4: Professional Tables with booktabs

For publication-quality tables, use the booktabs package. It provides cleaner horizontal rules without vertical lines:

ItemQtyPrice
Apples5$2.50
Oranges3$1.80
Bananas8$3.20
Total16$7.50

Part 5: Spanning Multiple Columns

Use \multicolumn to merge cells across columns:

Quarterly Sales Report
Q1Q2Q3
$100k$150k$200k

Part 6: Spanning Multiple Rows

Use the multirow package to merge cells vertically:

Use * for automatic width, or specify like 2cm.

Part 7: Floating Tables with Captions

Wrap your tabular in a table environment for positioning and captions:

Position options: h (here), t (top), b (bottom), p (separate page), ! (override)

Part 8: Fixed-Width Columns

For text that needs to wrap, use p{width}, m{width}, or b{width}:

SpecifierVertical Alignment
p{2cm}Top-aligned
m{2cm}Middle-aligned (requires array package)
b{2cm}Bottom-aligned (requires array package)

Part 9: Full-Width Tables with tabularx

The tabularx package creates tables that span a specific width:

The X column type expands to fill remaining space, distributing it equally among all X columns.

Part 10: Coloring Tables

Use the xcolor package with the table option for colored tables:

Complete Example: Publication-Ready Table

The siunitx package with S columns automatically aligns decimal points.

Best Practices Checklist

  • Use booktabs for professional-looking tables without vertical lines
  • Always include a caption and label for referenced tables
  • Right-align numerical data for easy comparison
  • Use siunitx for proper number formatting
  • Keep tables simple and avoid unnecessary borders
  • Use \centering instead of the center environment
  • Consider using tabularx for full-width tables
Underleaf Logo
Underleaf

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

Go to appContact us

Company

PricingBlogTutorialsConference TemplatesConference Deadlines

Free Tools

Image to LaTeXExcel to LaTeXArXiv to LaTeXTikZ GeneratorLaTeX Table GeneratorCitation GeneratorThesis GeneratorChrome ExtensionAll Tools

Ask AI about Underleaf

Ask ChatGPTAsk ClaudeAsk Perplexity

© 2026 Underleaf. All rights reserved.