# Alignment and dotfill in 3-column longtable

I am trying to create a 6.5in longtable with 3 columns (Name, Major/University, Date). I would like the first and second cells to be left-aligned, while the third cell is right-aligned. I want to use \dotfill between the cells.

I am still new to customizing the parameters in tables, but this is what I have now. As can be seen, there is a space between the dots in the 2nd and 3rd cell for each row. I would like it if I could close this gap, and I'm not sure how. I tried putting @{} after the >{\dotfill\raggedleft\arraybackslash} but that raised an error.

Here is a MWE and picture of output.

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


simpler to use two columns:

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

• While this is a good workaround, I have to manually put the \dotfills in the table content, which I don't want to do. How can I solve this without using \dotfill in the table content? Jun 27, 2019 at 1:45
• @Abraham, In your question title you require to have \dotfill. If you not liked, than just remove them from table specification in your MWE. Jun 27, 2019 at 5:48
• @Abraham I don't see it as any different really, in your suggested markup you manually separate by & and here I separate by \dotfill it's just a single tex token in either case. In practice I would use \newcommand\myrow[3]{#1&#2\dotfill#3\\} and then \myrow{foo}{bar}{2019} which you could do whatever underlying syntax is used. Jun 27, 2019 at 6:54
• Ah, I see. Good idea to use a \newcommand for this purpose, that helps! Thanks, I'll mark this as the accepted answer :) Jun 27, 2019 at 18:37