It's been a while since I asked an embarrassing question, so here is one for your amusement: I want to print a table of numbers that is able to adapt to various column sizes so can't use a tabular like environment.
Well, I thought that this would be straight forward and a simple solution such as to use a \makebox[3em][r]{} should work. And of course, I need a space on one side so that it could break at line boundaries.
And it fact it works pretty good, but not exactly right. So what I have below only seems to only have a problem with the last row as I get the following result with the MWE below:

Code:
\documentclass{article}
\usepackage{showframe}
\usepackage{pgffor}
\newcommand*{\ListOrPrimes}{%
2, 3, 5, 7, 11, 13, 17, 19, 23, 29,
31, 37, 41, 43, 47, 53, 59, 61, 67, 71,
73, 79, 83, 89, 97, 101, 103, 107, 109, 113,
127, 131, 137, 139, 149, 151, 157, 163, 167, 173,
179, 181, 191, 193, 197, 199, 211, 223, 227, 229
}%
\begin{document}
\noindent
The sequence of primes is:
\medskip
{\raggedright%
\par\noindent\foreach \x in \ListOrPrimes{%
\makebox[4em][r]{\x}\space%
}%
\end{document}

%after229. – Werner Jan 28 at 7:31229comes with a trailing space. And, since you're using aright-aligned\makebox, only the trailing space of an entry is revealed this way. – Werner Jan 28 at 7:33\makebox[4em][r]{\x\unskip}for the definition inside\pgffor? – Werner Jan 28 at 7:36