How to Create Beautiful Tables That Fit the Page in LaTeX
Português: Leia este tutorial em português.
A professional LaTeX table should be readable, aligned, and limited to the information the reader actually needs. Good typography usually comes from thoughtful structure rather than heavy borders or very small text.
Start with booktabs
\usepackage{booktabs}
The package provides balanced horizontal rules and discourages unnecessary vertical lines.
\begin{table}[htbp]
\centering
\caption{Performance by group.}
\label{tab:performance}
\begin{tabular}{lcc}
\toprule
Group & Average & Pass Rate \\
\midrule
A & 8.2 & 91\% \\
B & 7.6 & 84\% \\
C & 7.9 & 88\% \\
\bottomrule
\end{tabular}
\end{table}
Use tabularx for flexible text columns
When a description column must wrap to fit the available width, use tabularx:
\usepackage{tabularx}
\begin{tabularx}{\textwidth}{lXr}
\toprule
Item & Description & Value \\
\midrule
A & A longer description that wraps automatically. & 25 \\
B & Another description adjusted to the page width. & 31 \\
\bottomrule
\end{tabularx}
The X column expands and wraps automatically. Use it for prose while keeping short values in fixed columns.
Align numerical data with siunitx
\usepackage{siunitx}
\begin{tabular}{l S[table-format=2.2]}
\toprule
Sample & {Measurement} \\
\midrule
A & 9.50 \\
B & 12.75 \\
C & 3.20 \\
\bottomrule
\end{tabular}
siunitx aligns decimal markers and can format units consistently.
Create multi-page tables
Use longtable when a table must continue across pages:
\usepackage{longtable}
\begin{longtable}{lp{0.65\textwidth}}
\caption{Complete item list.} \\
\toprule
Code & Description \\
\midrule
\endfirsthead
\toprule
Code & Description \\
\midrule
\endhead
A01 & First description. \\
A02 & Second description. \\
\bottomrule
\end{longtable}
Repeat the header on each page so the table remains understandable.
When a table is too wide
- Remove columns that are not essential.
- Shorten headings without losing meaning.
- Allow descriptive text to wrap.
- Switch to landscape orientation only when necessary.
- Reduce font size modestly as a last resort.
Avoid relying on \resizebox for large tables. Scaling can make text unreadable and hide a structural problem.
Improve spacing
\renewcommand{\arraystretch}{1.15}
\setlength{\tabcolsep}{6pt}
\arraystretch controls row height and \tabcolsep controls horizontal cell padding. Small adjustments are usually enough.
Table checklist
- Use a clear caption and a meaningful label.
- Put units in headings instead of repeating them in every row.
- Align comparable values consistently.
- Avoid excessive borders and background colors.
- Do not split a logical record across pages.
- Review the table at normal reading size in the final PDF.
Use the table structure already available in a TexDrop template and adapt it to your content instead of rebuilding the layout for every project.