纵向页面上的横向表格

纵向页面上的横向表格

我有一个纵向页面,其中有一个部分标题,我想在其下方放置一个横向的表格(因为在这个方向上它应该占据页面的大部分剩余部分)。

我可以让整个页面横向显示,但是,如果我这样做,章节标题就不会出现在同一页面上。

我目前的尝试(将表格粘贴在新的横向页面上,如下所示:

\documentclass[a4paper]{report}
\newcommand{\ra}[1]{\renewcommand{\arraystretch}{#1}}
\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}

如果有人对我如何实现这一点有任何建议,或者,如果这不可能,最好的替代解决方案是什么。

答案1

解决方案有两个方面,感谢@David Carlilse 提出使用该rotating包的想法。

首先,tabularx表格内部需要放在一个sideways块内。

其次,tabularx需要告知\textheight而不是 ,\textwidth以便它知道表格的总宽度,以便进行X列计算。但是,这会导致列与页码重叠,因此我们减去 3cm 作为边距。

该部分现在内容如下:

\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}

相关内容