A landscape table or page in LaTeX
Help centre › LaTeX › Tables · Packages: pdflscape, rotating
Load \usepackage{pdflscape} and put the table (or any content) between \begin{landscape} and \end{landscape}: those pages are set sideways and shown turned in a PDF viewer. Alternatively, load \usepackage{rotating} and write sidewaystable in place of table; the table is a float rotated on a page of its own.
A complete example
A whole document: paste it into an empty project and compile it.
\documentclass{article}
\usepackage{pdflscape}
\usepackage{booktabs}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{landscape}
\begin{table}[htbp]
\centering
\caption{A wide table on a landscape page.}\label{tab:wide}
\begin{tabular}{lrrrrrrrrrr}
\toprule
Region & 2015 & 2016 & 2017 & 2018 & 2019 & 2020 & 2021 & 2022 & 2023 & 2024 \\
\midrule
North & 10.1 & 10.4 & 10.9 & 11.2 & 11.8 & 10.7 & 11.5 & 12.0 & 12.4 & 12.9 \\
South & 8.3 & 8.5 & 8.4 & 8.9 & 9.2 & 8.6 & 9.0 & 9.5 & 9.9 & 10.2 \\
East & 7.7 & 7.9 & 8.2 & 8.5 & 8.8 & 8.1 & 8.6 & 9.1 & 9.4 & 9.6 \\
\bottomrule
\end{tabular}
\end{table}
\end{landscape}
Table~\ref{tab:wide} shows ten years. \lipsum[2]
\end{document}pdflscape: landscape pages
Everything in the landscape environment is set on pages turned through 90 degrees, with the page's long side as the line width. The environment starts a new page and ends with one, so the text before and after stays upright on its own pages. pdflscape (unlike the plain lscape package it builds on) also marks those pages as rotated in the PDF, so a reader on screen sees them the right way up.
Anything can go inside: a table float, a longtable running over several landscape pages, a wide figure.
rotating: sidewaystable and sidewaysfigure
sidewaystable and sidewaysfigure are floats like table and figure, but turned sideways, each on a page of its own. The text keeps flowing on the pages around it, so no gap is left where the table is written. The PDF page itself is not turned: the reader turns the page, or the screen.
In two-sided documents the direction of rotation depends on the page being odd or even; the package options figuresright or figuresleft fix one direction for all.
\documentclass{article}
\usepackage{rotating}
\usepackage{lipsum}
\begin{document}
\lipsum[1]
\begin{sidewaystable}
\centering
\caption{A sideways float.}\label{tab:side}
\begin{tabular}{lrrrrrrrr}
\hline
Item & Q1 & Q2 & Q3 & Q4 & Q5 & Q6 & Q7 & Q8 \\
\hline
Alpha & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 \\
Beta & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 \\
\hline
\end{tabular}
\end{sidewaystable}
Table~\ref{tab:side} is on its own page. \lipsum[2]
\end{document}Only the column heads sideways
When the table is narrow except for long column heads, turn just the heads with \rotatebox{90}{Head} (graphicx), and keep the page upright.
\begin{tabular}{lccc}
& \rotatebox{90}{Sensitivity} & \rotatebox{90}{Specificity} & \rotatebox{90}{Accuracy} \\
\hline
Model A & 0.91 & 0.85 & 0.88 \\
\end{tabular}Common mistakes
- Using
lscapeinstead ofpdflscape: the page is rotated on paper but shown sideways on screen. - Expecting
landscapeto stay on the current page: it always starts a new page, leaving the rest of the current page empty if the text before it is short.sidewaystableavoids that gap. - Using
\resizeboxto squeeze a very wide table into portrait instead: the text becomes unreadably small. Rotate it.
Errors you may meet
- LaTeX Error: Environment <name> undefined\begin{…} names an environment no loaded package defines: load the package (amsmath for align), fix the spelling, or define it with \newtheorem.
- LaTeX Warning: Float too large for page by <n>pt on input line <n>.A figure or table is taller than the text area, so it overprints the footer or runs off the page. Scale it to fit, or split a long table.
- Overfull \hbox (<n>pt too wide) in paragraph at lines <a>--<b>A line sticks out into the margin because TeX found no acceptable place to break it: a long URL or word, or an image or equation wider than the column.
In Manulyx
Insert → Table puts a table environment in place, and pasting a range copied from a spreadsheet (two or more rows and columns) goes in as a LaTeX table, with booktabs rules when the paper loads booktabs and \hline otherwise; a notice offers the plain text back.
Write in Manulyx for free · Journal templates
Related
- A table across several pages in LaTeX (longtable)Break a long LaTeX table across pages with longtable, repeating the header on each page and adding a "continued" note, with booktabs rules.
- Make a LaTeX table fit the page widthFit a too-wide LaTeX table: tabularx X columns, p{} columns that wrap, a smaller font, less column spacing, and why \resizebox is a last resort.
- Place a figure exactly here in LaTeX (stop it floating)Keep a LaTeX figure where you wrote it: [htbp] options, [H] from the float package, \FloatBarrier from placeins, and \clearpage to flush waiting figures.
- Merge cells in a LaTeX table: multirow and multicolumnMerge table cells across columns with \multicolumn and across rows with \multirow (multirow package), with booktabs rules and \cline/\cmidrule.
- Table notes and footnotes in a LaTeX table (threeparttable)Add notes under a LaTeX table with markers in the cells, using threeparttable's \tnote and tablenotes, and why \footnote inside a table goes missing.
- Professional-looking tables in LaTeX with booktabsMake LaTeX tables look typeset: booktabs rules (\toprule, \midrule, \bottomrule, \cmidrule), no vertical lines, and aligned numbers.
The examples on this page were compiled with pdfLaTeX to check that they work as shown. LaTeX quick reference · LaTeX errors explained