我正在尝试创建一个 6.5 英寸的表格,longtable
其中包含 3 列(姓名、专业/大学、日期)。我希望第一和第二个单元格左对齐,而第三个单元格右对齐。我想\dotfill
在单元格之间使用。
我对表格中自定义参数还不熟悉,但这就是我现在所拥有的。可以看出,每行第 2 格和第 3 格的点之间有一个空隙。我希望可以填补这个空隙,但我不知道该怎么做。我尝试@{}
在后面放置>{\dotfill\raggedleft\arraybackslash}
但是却引发了错误。
这是 MWE 和输出图片。
\documentclass{minimal}
\usepackage{longtable}
\usepackage{array}
\begin{document}
\begin{center}
\begin{longtable}{@{}p{1.625in}<{\dotfill}@{}p{3.875in}<{\dotfill}@{}@{}>{\dotfill\raggedleft\arraybackslash}p{1in}@{}}
First Last & Some Thing and Some Thing, Some Where and Some Where & 2019 \\
FirstFirst LastLast & Some Thing and Some Other Thing, Some Where, Somewhere & 2019 \\
FirstFirst Last & Something, Somewhere & 2018 - 2019 \\
First LastLast & Something Something, Somewhere Somewhere & Fall 2019 \\
First Middle Last & Thing, Where & Summer 2019 \\
First Middle Middle Last & Something, Where & Spring 2019 \\
First Last & Something Some Other Thing, Somewhere and Somewhere & Winter 2019 \\
\end{longtable}
\end{center}
\end{document}
答案1
使用两列更简单:
\documentclass{minimal}
\usepackage{longtable}
\usepackage{array}
\begin{document}
% not around longtable \begin{center}
\begin{longtable}{@{}p{1.625in}<{\dotfill}@{}p{4.875in}@{}}
First Last & Some Thing and Some Thing, Some Where and Some Where \dotfill 2019 \\
FirstFirst LastLast & Some Thing and Some Other Thing, Some Where, Somewhere \dotfill 2019 \\
FirstFirst Last & Something, Somewhere \dotfill 2018 - 2019 \\
First LastLast & Something Something, Somewhere Somewhere \dotfill Fall 2019 \\
First Middle Last & Thing, Where \dotfill Summer 2019 \\
First Middle Middle Last & Something, Where \dotfill Spring 2019 \\
First Last & Something Some Other Thing, Somewhere and Somewhere \dotfill Winter 2019 \\
\end{longtable}
% \end{center}
\end{document}