[Tex/LaTex] different column widths in a tabular

columnstableswidth

I would like that the width of the first column of an array to be 2cm and the second column to be 1cm. I have the following document but apparently the setting for the width of the second column is not working.

  \documentclass{book}
    \usepackage{multicol}
    \begin{document}
    \begin{multicols}{2}
    \noindent
     \begin{tabular}{ p{2cm} l   p{1cm} r}
     abc abc abc abc   & xyz xyz xyz xyz xyz \\
     \end{tabular}
    \end{multicols}
    \end{document}

Best Answer

The problem is the unnecessary l annd r in \begin{tabular}{ p{2cm} l p{1cm} r}:

\documentclass{book}
\usepackage{multicol}
\begin{document}
    \begin{multicols}{2}
    \noindent
        \begin{tabular}{ p{2cm}   p{1cm}}
        abc abc abc abc   & xyz xyz xyz xyz xyz \\

        aaaaaa   & bbbbbb bbbbbbbb bbbbbbbb bbbbbbb \\
        \end{tabular}
    \end{multicols}
\end{document}

Update: Regarding aligning the second column right, I recommend reading this answer

Related Question