![如何将标题移至旋转表格的顶部](https://linux22.com/image/377070/%E5%A6%82%E4%BD%95%E5%B0%86%E6%A0%87%E9%A2%98%E7%A7%BB%E8%87%B3%E6%97%8B%E8%BD%AC%E8%A1%A8%E6%A0%BC%E7%9A%84%E9%A1%B6%E9%83%A8.png)
可以将标题移至表格顶部吗?
谢谢你的帮助
\documentclass[letterpaper,11pt]{report}
\usepackage[figuresleft]{rotating}
\usepackage{adjustbox}
\usepackage{array}
\usepackage{amssymb}
\newcommand*\rot{\rotatebox{90}}
\newcommand*\OK{\checkmark}
\begin{document}
\clearpage
\begin{sidewaystable}[!t]
\caption{SQL injection mitigation techniques FCA}
\label{tbl:fcaSQL}
\centering
\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|c|}
\hline
\shortstack[]{CANDID} & \rot{\OK} & {} & \rot{\OK} & {} & {} & {} & \rot{\OK} & \rot{\OK} & {} & {} & {} &
\rot{\OK} & {} & {} & {} & {} & {} & {} \\ \cline{1-19}
\shortstack[]{CSSE} & \rot{\OK} & {} & {} & {} & \rot{\OK} & \rot{\OK} & \rot{\OK} & \rot{\OK} & {} & \rot{\OK} & \rot{\OK} &
\rot{\OK} & \rot{\OK} & {} & {} & {} & \rot{\OK} & {} \\ \cline{1-19}
\shortstack[1]{SQLCheck} & \rot{\OK} & {} & {} & {} & \rot{\OK} & \rot{\OK} & \rot{\OK} & {} & {} & {} & {} &
\rot{\OK} & \rot{\OK} & \rot{\OK} & {} & \rot{\OK} & \rot{\OK} & \rot{\OK} \\ \cline{1-19}
\shortstack[]{SQLGuard} & {} & \rot{\OK} & \rot{\OK} & {} & {} & { } & \rot{\OK} & \rot{\OK} & { } & {} & {} &
\rot{\OK} & \rot{\OK} & \rot{\OK} & { } & \rot{\OK} & \rot{\OK} & \rot{\OK} \\ \cline{1-19}
\shortstack[]{SQLProb} & {} & \rot{\OK} & { } & {} & \rot{\OK} & { } & \rot{\OK} & {} & { } & {} & {} &
\rot{\OK} & \rot{\OK} & \rot{\OK} & \rot{\OK} & \rot{\OK} & \rot{\OK} & \rot{\OK} \\ \cline{1-19}
\shortstack[]{SQLrand} & {} & \rot{\OK} & {} & \rot{\OK} & {} & \rot{\OK} & \rot{\OK} & \rot{\OK} & {} & {} & {} &
\rot{\OK} & {} & \rot{\OK} & {} & \rot{\OK} & \rot{\OK} & {} \\ \cline{1-19}
\shortstack[]{WASP} & \rot{\OK} & {} & { } & {} & \rot{\OK} & { } & {} & {} & \rot{\OK} & \rot{\OK} & {} &
\rot{\OK} & \rot{\OK} & \rot{\OK} & { } & \rot{\OK} & \rot{\OK} & \rot{\OK} \\ \cline{1-19}
\shortstack[]{Header\\Sanitization} & {} & \rot{\OK} & {} & \rot{\OK} & {} & {} & \rot{\OK} & \rot{\OK} & \rot{\OK} & {} & \rot{\OK} &
\rot{\OK} & \rot{\OK} & {} & {} & {} & {} & {} \\ \cline{1-19}
\shortstack[]{Network\\Analyzer} & \rot{\OK} & {} & {} & {} & \rot{\OK} & \rot{\OK} & {} & {} & \rot{\OK} & {} & \rot{\OK} &
\rot{\OK} & \rot{\OK} & \rot{\OK} & {} & {} & {} & {} \\ \cline{1-19}
\shortstack[]{Web App\\Firewall} & {} & \rot{\OK} & \rot{\OK} & {} & {} & {} & {} & \rot{\OK} & \rot{\OK} & {} & \rot{\OK} &
\rot{\OK} & \rot{\OK} & \rot{\OK} & {} & {} & {} & {} \\ \cline{1-19}
\rot{\shortstack[l]{\textbf{Mitigation}\\ \textbf{Name}}} &
\rot{\shortstack[l]{\textbf{Low}\\ \textbf{Programmer}\\ \textbf{Involvement}}} &
\rot{\shortstack[l]{\textbf{High}\\ \textbf{Programmer}\\ \textbf{Involvement}}} &
\rot{\shortstack[l]{\textbf{Automatic Code}\\ \textbf{Modification}}} &
\rot{\shortstack[l]{\textbf{Manual Code}\\ \textbf{Modification}}} &
\rot{\shortstack[l]{\textbf{No Code}\\ \textbf{Modification}}} &
\rot{\shortstack[l]{\textbf{Additional}\\ \textbf{Infrastructure}}} &
\rot{\shortstack[l]{\textbf{Open Source}}} &
\rot{\shortstack[l]{\textbf{Lang. Specific}}} &
\rot{\shortstack[l]{\textbf{Active}\\ \textbf{Development}}} &
\rot{\shortstack[l]{\textbf{Tracking}}} &
\rot{\shortstack[l]{\textbf{GET/POST}}} &
\rot{\shortstack[l]{\textbf{Tautology * }}} &
\rot{\shortstack[l]{\textbf{Logically }\\ \textbf{Incorrect * }}} &
\rot{\shortstack[l]{\textbf{Union Query * }}} &
\rot{\shortstack[l]{\textbf{Stored}\\ \textbf{Procedures * }}} &
\rot{\shortstack[l]{\textbf{Piggy-Back}\\ \textbf{Query * }}} &
\rot{\shortstack[l]{\textbf{Inference * }}} &
\rot{\shortstack[l]{\textbf{Alternative}\\ \textbf{Encodings * }}}\\ \cline{1-19}
\end{tabular}
\end{sidewaystable}
\end{document}
答案1
使用table
浮点数并旋转-90度表格环境解决那问题 ...
\begin{table}[!t]
\caption{SQL injection mitigation techniques FCA}
\label{tbl:fcaSQL}
\centering
\rotatebox{-90}{\begin{tabular} ... \end{tabular}}
\end{table}
但请注意底部边距以及它的外观......
我会做的可能更像这样......
\documentclass[letterpaper,11pt]{report}
\usepackage{booktabs,tabulary}
\usepackage{adjustbox}
\usepackage{array}
\usepackage{amssymb}
\newcommand*\rot{\rotatebox[origin=tr]{-90}}
\newcommand*\OK{\checkmark}
\begin{document}
\begin{table}
\belowcaptionskip1ex
\caption{SQL injection mitigation techniques FCA}
\label{tbl:fcaSQL}
\begin{tabulary}{\linewidth}{>{\em}lCCCCCCCCCC}\toprule
Mitigation Name &
\rot{CANDID} &
\rot{CSSE} &
\rot{SQLCheck} &
\rot{SQLGuard} &
\rot{SQLProb} &
\rot{SQLrand} &
\rot{WASP} &
\rot{Header Sanitization} &
\rot{Network Analyzer} &
\rot{Web App Firewall} \\\midrule
Low Programmer Involvement & \OK & & & & \OK & & \OK & \\
High Programmer Involvement & & \OK & \OK & \OK & & \OK & & \OK \\
Automatic Code Modification & & & \OK & & & & & & \OK \\
Manual Code Modification & & & & & \OK & & \OK & & \\
No Code Modification & \OK & \OK & & \OK & & \OK & & \OK & \\
Additional Infrastructure & \OK & \OK & & & \OK & & & \OK & \\
Open Source & \OK & \OK & \OK & \OK & \OK & \OK & & \OK & & \\
Language Specific & \OK & \OK & & \OK & & \OK & & \OK & & \OK \\
Active Development & & & & & & \OK & \OK & \OK & \OK \\
Tracking & & \OK & & & & & \OK & & & \\
GET/POST & & \OK & & & & & & \OK & \OK & \OK \\
Tautology * & \OK & \OK & \OK & \OK & \OK & \OK & \OK & \OK & \OK & \OK \\
Logically Incorrect * & \OK & \OK & \OK & \OK & & \OK & \OK & \OK & \OK \\
Union Query * & & & \OK & \OK & \OK & \OK & \OK & & \OK & \OK \\
Stored Procedures * & & & & \OK & & & & & \\
Piggy-Back Query * & & \OK & \OK & \OK & \OK & \OK & & & \\
Inference * & & \OK & \OK & \OK & \OK & \OK & \OK & & & \\
Alternative Encodings * & & \OK & \OK & \OK & & \OK & & & \\\bottomrule
\end{tabulary}
\end{table}
\end{document}