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

Errors you may meet

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

The examples on this page were compiled with pdfLaTeX to check that they work as shown. LaTeX quick reference · LaTeX errors explained