Prerequisites: Familiarity with basic table creation. See Creating Tables if you need a refresher.
Long Tables
Tables Spanning Multiple Pages
longtable-basic.tex
Ready to use this syntax? Continue in the browser editor when you want to adapt the example in a real project.Open LaTeX Cloud Studio
Longtable Features
longtable-advanced.tex
Landscape Tables
Rotating Large Tables
landscape-tables.tex
Rotating Table Content
rotating-content.tex
Nested and Complex Tables
Tables Within Tables
nested-tables.tex
Mixed Content Tables
mixed-content.tex
Professional Table Packages
Using booktabs
booktabs-professional.tex
Using threeparttable
threeparttable.tex
Advanced Formatting
Custom Column Types
custom-columns.tex
Conditional Formatting
conditional-formatting.tex
Table Automation
Generating Tables from Data
table-automation.tex
Dynamic Table Generation
dynamic-tables.tex
Table Positioning and Float Control
Precise Table Placement
table-placement.tex
Performance Optimization
Large Table Optimization
optimize-tables.tex
How to Shrink a Table to Fit the Page or Column
When a table is wider than the text block, LaTeX will not shrink it for you — it runs into the margin and reports anOverfull \hbox.
Scaling the whole table, font included, is the quickest fix. \resizebox from
graphicx takes a target width: \resizebox{\textwidth}{!}{...} wraps the
tabular and scales it to the text width, with ! preserving the aspect ratio. Use
\columnwidth instead in a two-column layout.
Be aware that this shrinks the font along with the table, so a heavily scaled table
becomes hard to read. Before scaling, consider whether reducing column padding with
\setlength{\tabcolsep}{4pt}, wrapping text with a p{3cm} column, or using a
smaller font size for the table would keep it legible.
For tables that are simply too wide to ever fit, rotating with sidewaystable from
rotating, or splitting across pages with longtable, is better than scaling.
Best Practices
Troubleshooting
Quick Reference
Package Summary
Advanced Commands
example.tex
Next: Ready to create your first LaTeX document? Check out our How-to Guides for practical examples and complete document templates.
