About a month ago, someone asked how to align a tabular environment around the intercolumn space, which was something I'd been trying to figure out for a brief eternity. Werner's answer worked more or less fine, though I had to add extra braces around \raggedright
. I was wondering, though, if someone could explain to me why it worked.
Here's the code that I'm using:
\usepackage{array}
%...
\noindent
\begin{tabular}
{>{\raggedleft}p{\dimexpr.5\linewidth-2\tabcolsep-.5\arrayrulewidth}|
>{{\raggedright}}p{\dimexpr.5\linewidth-2\tabcolsep-.5\arrayrulewidth}}
Kindle Edition Available & k \\
PC/Mac Edition Available & p
\end{tabular}
I think it's mostly the math for the paragraph widths that I'm not understanding, but I'd really appreciate it if someone could explain the whole thing in English. The part that I get is "insert the command \raggedright
before the first paragraph-style column and \raggedleft
before the second paragraph-style column"; otherwise I'm in the dark.
If I was unclear about what I'd been trying to do, here's the difference between what that block produces and what this one does:
\begin{center}
\begin{tabular}{rl}
Kindle Edition Available & k \\
PC/Mac Edition Available & p
\end{tabular}
\end{center}
Thanks so much for your help!
>{{\raggedright}}
then\raggedright
will be executed in a group and will have no effect.