3

How can I fill blank spaces with \dotfill in \tabbing environment? How can I adjust the length of \dotfill?

\documentclass{article}
\begin{document}

\begin{tabbing}
\hspace*{3cm}\=\hspace*{2cm}\= \kill
column1a \> column2a \> column3a \\
column1b \> column2b \> column3b 
\end{tabbing}

\end{document}

tabbing

1
  • 1
    Apparently, the cells’ contents are always boxed at their natural width; the space between cells in a row is added later.
    – egreg
    Commented Mar 10, 2017 at 11:34

1 Answer 1

3

You could try to replace tabbing by tabular or longtable:

\documentclass{article}
\usepackage{array}
\begin{document}

\begin{tabular}{@{}p{3cm}<{\dotfill}@{}p{2cm}<{\dotfill}@{}p{\dimexpr\linewidth-5cm}<{\dotfill}@{}}
column1a & column2a & column3a \\
column1b & column2b & column3b 
\end{tabular}

\end{document}

enter image description here

resp.

\documentclass{article}
\usepackage{array,longtable}
\begin{document}

\begin{longtable}{@{}p{3cm}<{\dotfill}@{}p{2cm}<{\dotfill}@{}p{\dimexpr\linewidth-5cm}@{}}
column1a & column2a & column3a \\
column1b & column2b & column3b 
\end{longtable}

\end{document}

enter image description here

2
  • How can I use this tabular of @Schweinebacke and change the last column to raggedleft? Commented Mar 14, 2023 at 15:12
  • @phasefieldguy Have you tried to add >{\dotfill} before the last column? >{…} and <{…} are documented in the array manual. Commented Aug 23, 2023 at 9:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .