![对齐表](https://linux22.com/image/371037/%E5%AF%B9%E9%BD%90%E8%A1%A8.png)
我无法对齐我的表格。
首先,Latex 会在一个页面上单独设置两个表格之间的距离。我希望它们之间的正常距离与页面的其余部分保持空白。而不是在一个页面上均匀分布。
其次,我有一个单独的侧向表格,它位于中央。我希望它从页面顶部开始,并且像以前一样,页面的其余部分为空。因此,横向页面的垂直对齐。我使用 \makeatletter 为普通表格实现了这一点...
\RequirePackage{rotating}
\documentclass[12pt, a4paper, listof=totoc, footlines=2, ngerman,english]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[T1]{fontenc}
\setlength{\parindent}{0em}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{gensymb}
\usepackage{mwe}
\usepackage{xpatch}
\makeatletter% Set distance from top of page to first float
\setlength\@fptop{0\p@}
\makeatother
\begin{document}
\begin{table}
\centering
\caption{Something}
\label{tab:14}
\begin{tabular}{ccccccc}
\toprule
\textbf{No.} &\textbf{AAAAAA} & \textbf{BBBBBB}& \textbf{CCCCCC}& \textbf{DDDDDD}& \textbf{EEEEEE}& \textbf{F} \\
\midrule
600 & 600 & 100 & 200 & 100 & - & - \\
600 & 600 & 100 & 200 & - & 100 & - \\
600 & 600 & 100 & 200 & - & - & 100\\
600 & 600 & 100 & 250 & 50 & - & - \\
600 & 600 & 100 & 250 & - & 50 & - \\
600 & 600 & 100 & 250 & - & - & 50 \\
\bottomrule
\end{tabular}
\end{table}
\begin{table}
\centering
\caption{Something1}
\label{tab:15}
\begin{tabular}{cccccc}
\toprule
\textbf{AAAA} &\textbf{BBBB}/nm & \textbf{CCCCC}/\% & \textbf{DDDDD}/s& \textbf{EEEEE}/J& \textbf{FFFFFF}/N\\
\midrule
600 & - & 123 & 123 & - & 12345 \\
600 & - & 123 & 123 & - & - \\
600 & - & 123 & 123 & - & - \\
600 & 600.7 & 600.5 & 4.01 & - & - \\
600 & 600.0 & 600.9 & 2.73 & - & - \\
600 & 600.3 & 600.7 & 1.75 & - & - \\
600 & 600.7 & 600.9 & 2.40 & - & - \\
\bottomrule
\end{tabular}
\end{table}
\clearpage
\begin{sidewaystable}
\centering
\caption{LALALALALALALALALALAL}
\label{tab:16}
\begin{tabular}{ccccccccc}
\toprule
\textbf{No.} &\textbf{AAAAAAAAA} &\textbf{AAAAAAAAAA} & \textbf{VVVVVVV} &\textbf{XXX} &\textbf{AAAA} & \textbf{CCCCT}& \textbf{XXNT}& \textbf{BIBIBI} \\
\midrule
600 & 614 & 650 & 100 & 200 & 50 & - & - & 50\\
600 & 614 & 650 & 100 & 200 & 50 & - & - & 80\\
600 & 615 & 650 & 100 & 200 & - & 50 & - & 50\\
600 & 615 & 650 & 100 & 200 & - & 50 & - & 80\\
600 & 616 & 650 & 100 & 200 & - & - & 50 & 50\\
600 & 616 & 650 & 100 & 200 & - & - & 50 & 80\\
\bottomrule
\end{tabular}
\end{sidewaystable}
\end{document}
也许我应该使用更多的小页面,因为浮动有时很糟糕。
问候
答案1
只需对前两个表格使用可选参数即可[!htb]
。对于横向表格,\hfill
只需在 之前添加 即可\begin{tabular}
。
无关的,我用更正确的尾字符替换了表格中的连字符。
\documentclass[12pt, a4paper, listof=totoc, footlines=2, ngerman,english]{scrreprt}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage[T1]{fontenc}
\usepackage{showframe}
\renewcommand{\ShowFrameLinethickness}{0.3pt}
\setlength{\parindent}{0em}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{graphicx, rotating}
\usepackage{booktabs}
\usepackage{gensymb}
\usepackage{mwe}
\usepackage{xpatch}
\makeatletter% Set distance from top of page to first float
\setlength\@fptop{0\p@}
\makeatother
\setlength{\belowcaptionskip}{1ex}
\begin{document}
\begin{table}[!htb]
\centering
\caption{Something}
\label{tab:14}
\begin{tabular}{ccccccc}
\toprule
\textbf{No.} &\textbf{AAAAAA} & \textbf{BBBBBB}& \textbf{CCCCCC}& \textbf{DDDDDD}& \textbf{EEEEEE}& \textbf{F} \\
\midrule
600 & 600 & 100 & 200 & 100 & – & – \\
600 & 600 & 100 & 200 & – & 100 & – \\
600 & 600 & 100 & 200 & – & – & 100\\
600 & 600 & 100 & 250 & 50 & – & – \\
600 & 600 & 100 & 250 & – & 50 & – \\
600 & 600 & 100 & 250 & – & – & 50 \\
\bottomrule
\end{tabular}
\end{table}
\begin{table}[!htb]
\centering
\caption{Something1}
\label{tab:15}
\begin{tabular}{cccccc}
\toprule
\textbf{AAAA} &\textbf{BBBB}/nm & \textbf{CCCCC}/\% & \textbf{DDDDD}/s& \textbf{EEEEE}/J& \textbf{FFFFFF}/N\\
\midrule
600 & – & 123 & 123 & – & 12345 \\
600 & – & 123 & 123 & – & – \\
600 & – & 123 & 123 & – & – \\
600 & 600.7 & 600.5 & 4.01 & – & – \\
600 & 600.0 & 600.9 & 2.73 & – & – \\
600 & 600.3 & 600.7 & 1.75 & – & – \\
600 & 600.7 & 600.9 & 2.40 & – & – \\
\bottomrule
\end{tabular}
\end{table}
\clearpage
{\rotFPtop = 0pt plus 0.18 fil
\begin{sidewaystable}[
\centering
\caption{LALALALALALALALALALAL}
\label{tab:16}
\begin{tabular}{ccccccccc}
\toprule
\textbf{No.} &\textbf{AAAAAAAAA} &\textbf{AAAAAAAAAA} & \textbf{VVVVVVV} &\textbf{XXX} &\textbf{AAAA} & \textbf{CCCCT}& \textbf{XXNT}& \textbf{BIBIBI} \\
\midrule
600 & 614 & 650 & 100 & 200 & 50 & – & – & 50\\
600 & 614 & 650 & 100 & 200 & 50 & – & – & 80\\
600 & 615 & 650 & 100 & 200 & – & 50 & – & 50\\
600 & 615 & 650 & 100 & 200 & – & 50 & – & 80\\
600 & 616 & 650 & 100 & 200 & – & – & 50 & 50\\
600 & 616 & 650 & 100 & 200 & – & – & 50 & 80\\
\bottomrule
\end{tabular}
\end{sidewaystable}}