# Landscape table on portrait page

I have a portrait page with a section heading below which I would like to place a table in landscape (as in this orientation it should take up most of the rest of the page).

I can get the whole page in landscape and do it that way, however, if I do this, the section heading does not appear on the same page.

My current attempt (which sticks the table on a new, landscape, page looks like this:

\documentclass[a4paper]{report}
\usepackage{booktabs}
\usepackage{float}
\usepackage{tabularx}
\usepackage{pdflscape}
\begin{document}
\section{Appendix B - Risk Assessment}
\begin{landscape}
\begin{table}[H]
\centering\ra{1.3}
\caption{Table to show risks, hazards and mitigation techniques for this experiment}
\label{tbl:RiskMatrix}
\begin{tabularx}{\linewidth}{X X c X c c}
\toprule
Description of Hazard & Consequences & Risk Before & Mitigations Required & Risk After & ALARP? (Yes/No) \\ [0.5ex]
\midrule
Electrocution & Serious injury or death & 0.5 & Ensure hands are dry when plugging in. Do not tamper with any electrical components & 0.1 & Yes \\
Burns from hot components & Non-serious burns & 0.7 & Wear thermally insulated gloves when operating equipment & 0.2 & Yes \\
Burns from steam & Very serious burns, potential loss of sight & 0.6 & Wear safety goggles and a lab coat to protect from steam egress & 0.2 & Yes \\
Loss of apparatus integrity & Injuries from shrapnel, serious burns, potentially fatal & 0.3 & Check equipment for signs of buckling before use. Ensure that it remains within safe operating pressures. Ensure ballistic screen is in place around equipment. & 0.2 & Yes \\\bottomrule
\end{tabularx}
\end{table}
\end{landscape}

\end{document}


If anyone would have any suggestions on how I could achieve this or, if this is not possible, what the best alternative solution might be.

• Welcome to TeX.SX! A minimal working example (MWE), that illustrates your problem with compilable code (starting with \documentclass and ending with \end{document}) would be nice. - Does this question and answers help you? – Bobyandbob Oct 19 '17 at 10:18
• landscape always starts a new page use sidewaystable from the rotating package (or just \rotatebox around the tabular if you don't want to rotate the caption) – David Carlisle Oct 19 '17 at 10:23
• Apologies, I've just gotten so used to just posting snippets over on SE, I've updated my answer. The QA linked appears to address the inverse problem, moving headers rather than the tables. @DavidCarlisle I'll have a look at that and get back to you, thanks! – Persistence Oct 19 '17 at 10:24
• @DavidCarlisle changing \begin{table} to \begin{sidewaystable} (and the \end) has caused my table to vanish. Do you know what could be causing this off the top of your head? If not, I'll dig through the docs – Persistence Oct 19 '17 at 10:27
• I just tried the \rotatebox too and that just results in a mangled table with overlapping columns and text. – Persistence Oct 19 '17 at 10:37

The solution is twofold, thanks to @David Carlilse for the idea to use the rotating package.

Firstly, the tabularx inside the table needs to be placed inside a sideways block.

Secondly, tabularx needs to be told the \textheight instead of the \textwidth so that it knows the total width of the table for its X column calculations. However, this results in the column overlapping with the page number so we subtract 3cm for margin.

The section now reads like this:

\section{Appendix B - Risk Assessment}
\begin{table}[H]
\centering\ra{1.3}
\caption{Table to show risks, hazards and mitigation techniques for this experiment}
\label{tbl:RiskMatrix}
\begin{sideways}
\begin{tabularx}{\textheight - 3cm}{X X c X c c}
\toprule
Description of Hazard & Consequences & Risk Before & Mitigations Required & Risk After & ALARP? (Yes/No) \\ [0.5ex]
\midrule
Electrocution & Serious injury or death & 0.5 & Ensure hands are dry when plugging in. Do not tamper with any electrical components & 0.1 & Yes \\
Burns from hot components & Non-serious burns & 0.7 & Wear thermally insulated gloves when operating equipment & 0.2 & Yes \\
Burns from steam & Very serious burns, potential loss of sight & 0.6 & Wear safety goggles and a lab coat to protect from steam egress & 0.2 & Yes \\
Loss of apparatus integrity & Injuries from shrapnel, serious burns, potentially fatal & 0.3 & Check equipment for signs of buckling before use. Ensure that it remains within safe operating pressures. Ensure ballistic screen is in place around equipment. & 0.2 & Yes \\\bottomrule
\end{tabularx}
\end{sideways}
\end{table}

• if you are using that form you don't need rotating you could just use graphicx and replace begin{sideways}...\end{sidways} by \rotatebox{90}{...} (which is how it's defined) – David Carlisle Oct 19 '17 at 11:33