如何确定长表中列的宽度

如何确定长表中列的宽度

我用 longtable 写了一个表格。它工作正常,但我想改进列宽的布局。在下图中你可以看到结果:在此处输入图片描述

如您所见,最后一列非常接近页眉,所以我想减小 B 列的宽度(它有太多不需要的空间)。

我尝试修改 B 列和 C 列的宽度(C 列离 B 列太远)但结果没有改变。

你能帮助我吗?我也发布了我的代码:

\landscape
\begin{longtable}{p{2.5cm}p{0.5cm}p{2cm}p{4cm}p{3.5cm}p{2.5cm}p{1.5cm}}

\caption{Table name.......................}
\label{tab:Summary} \\

\toprule
\textbf{AAAAAA} &\textbf{BBBBB} &\textbf{CCCCC} &\textbf{DDDDD DDDDDD} &    \textbf{EEEE EEEEEEE} & \textbf{IFFFF ffff} &\textbf{EEEEEEEEE}\\

\midrule
\endfirsthead
% intestazione normale
\multicolumn{2}{l}{\footnotesize\itshape\tablename~\thetable:
continued from previous page} \\
\toprule
\textbf{AAAAAA} &\textbf{BBBBB} &\textbf{CCCCC} &\textbf{DDDDD DDDDDD} &    \textbf{EEEE EEEEEEE} & \textbf{IFFFF ffff} &\textbf{EEEEEEEEE}\\
\midrule
\endhead

\midrule
\multicolumn{2}{r}{\footnotesize\itshape\tablename~\thetable:
Continued on next page} \\
\endfoot
% piede finale
\bottomrule
\multicolumn{2}{r}{\footnotesize\itshape\tablename~\thetable:
It ends from the previous page.} \\
\endlastfoot
% corpo della tabella
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline



\end{longtable}
\endlandscape

你能帮助我吗?提前致谢

答案1

对于单行条目,使用更自然的方式l,让表格找到内容的自然宽度,同时您还需要允许脚注跨越更多列。也是landscape一个环境。

在此处输入图片描述

\documentclass{article}

\usepackage{longtable,pdflscape,booktabs}

\begin{document}
\begin{landscape}
\begin{longtable}{lllp{2cm}p{4cm}lp{3.5cm}}

\caption{Table name.......................}
\label{tab:Summary} \\

\toprule
\textbf{AAAAAA} &\textbf{BBBBB} &\textbf{CCCCC} &\textbf{DDDDD DDDDDD} &    \textbf{EEEE EEEEEEE} & \textbf{IFFFF ffff} &\textbf{EEEEEEEEE}\\

\midrule
\endfirsthead
% intestazione normale
\multicolumn{7}{l}{\footnotesize\itshape\tablename~\thetable:
continued from previous page} \\
\toprule
\textbf{AAAAAA} &\textbf{BBBBB} &\textbf{CCCCC} &\textbf{DDDDD DDDDDD} &    \textbf{EEEE EEEEEEE} & \textbf{IFFFF ffff} &\textbf{EEEEEEEEE}\\
\midrule
\endhead

\midrule
\multicolumn{7}{r}{\footnotesize\itshape\tablename~\thetable:
Continued on next page} \\
\endfoot
% piede finale
\bottomrule
\multicolumn{7}{r}{\footnotesize\itshape\tablename~\thetable:
It ends from the previous page.} \\
\endlastfoot
% corpo della tabella
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline
AAAAAA al. & AAAAAA & BBBBBBB & description description description description & description description description description description & bbbbbbb & aaaaaa and bbbbb\\

\hline



\end{longtable}
\end{landscape}
\end{document}

相关内容