# How can I get rid of space after a tabular, aligned to the right via \hfill?

I'd like to get rid of the additional empty space on the right between \begin{tabular}{ll} \textsc{place,} & \textsc{date}\\ Place, & \today \end{tabular} % and the right page margin/border:

The title isn't the best I admit, if anyone knows a better one feel free to edit it and this line please.

MWE

\documentclass[
fontsize=12pt,
a4paper,
DIV=15,
parskip=half
]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{
lmodern,
lipsum
}

\listfiles

\begin{document}
%\vspace{0.5cm}
\begin{flushleft}
Words\\
More Words
\end{flushleft}%
\begin{tabular}{@{}l}
\textsc{code}\\
11-22-33-44
\end{tabular}%
\hfill
\begin{tabular}{ll}
\textsc{place,} & \textsc{date}\\
Place, & \today
\end{tabular}
\begin{flushleft}
\bfseries Words
\end{flushleft}
\begin{flushleft}
Something,
\end{flushleft}
\lipsum[3]
\end{document}

• Adding a \\ after the \end{tabular} seems to do it, along with @{} after the ll – Steven B. Segletes Jan 9 '14 at 11:11
• you need @{} you did it in one table but not the other \begin{tabular}{ll@{}} also never do ar} % which can put a space after the table in some circumstances, do ar}% – David Carlisle Jan 9 '14 at 11:11

You need a l@{} so the text has no tabcolsep padding on the right (just as you have already used at the left margin in other tables. Then you need to make sure that the \hfill is not balanced by the \parfillskip glue that is added to the last line of a paragraph. As you want the same effect on both sides, center is an appropriate environment.

\documentclass[
fontsize=12pt,
a4paper,
DIV=15,
parskip=half
]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{
lmodern,
lipsum
}

\listfiles

\begin{document}
\begin{flushleft}
Words\\
More Words
\end{flushleft}%
\begin{center}
\noindent\begin{tabular}{@{}l}
\textsc{code}\\
11-22-33-44
\end{tabular}%
\hfill
\begin{tabular}{ll@{}}
\textsc{place,} & \textsc{date}\\
Place, & \today
\end{tabular}
\end{center}
\begin{flushleft}
\bfseries Words
\end{flushleft}
\begin{flushleft}
Something,
\end{flushleft}
\lipsum[3]
\end{document}


Played around a bit and found

\begin{tabular}{ll@{}}
\textsc{place,} & \textsc{date}\\
Place, & \today
\end{tabular}\\


works. => MWE

\documentclass[
fontsize=12pt,
a4paper,
DIV=15,
parskip=half
]{scrartcl}

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}

\usepackage{
lmodern,
lipsum
}

\listfiles

\begin{document}
\begin{flushleft}
Words\\
More Words
\end{flushleft}%
\noindent\begin{tabular}{@{}l}
\textsc{code}\\
11-22-33-44
\end{tabular}%
\hfill
\begin{tabular}{ll@{}}
\textsc{place,} & \textsc{date}\\
Place, & \today
\end{tabular}\\
\begin{flushleft}
\bfseries Words
\end{flushleft}
\begin{flushleft}
Something,
\end{flushleft}
\lipsum[3]
\end{document}


• No. never end a paragraph with \\  – David Carlisle Jan 9 '14 at 11:14
• I phrased it strictly there to overcome the slight problem that in this case \\  worked rather well:-) But it's a bad habit to get in to and in most circumstances it does the wrong thing. more discussion at tex.stackexchange.com/questions/82664/when-to-use-par-and-when/… – David Carlisle Jan 9 '14 at 11:34