1

MWE:

\documentclass[]{article}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{array}

\begin{document}
\pagenumbering{gobble}

\begin{center}

    \begin{tabular}{cp{7.5cm}p{2.4cm}}

        \textbf{L4} &
        For a sound explanation of both budget lines and indifference curves and a clear link to the separate demand curve, sound explanation of link between utility, price and demand, with accurate clear diagrams and a clear understanding of the principles involved. 
        &\textbf{[9--12]}\\
    \end{tabular}

\end{center}


\end{document}

With this code, the rightmost and leftmost columns have their text aligned to the top.

I would like the rightmost column (L4) to be aligned top, and the leftmost ([9--12]) to be aligned bottom.

How do I achieve this?

  • I've tried using m, b, and p - didn't work. – Thevesh Theva Aug 27 '18 at 10:15
2

All that I did was to add &\\[-\normalbaselineskip]& between the 2nd and last columns on every row.

\documentclass[]{article}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{array}

\begin{document}
\pagenumbering{gobble}

\begin{center}

    \begin{tabular}{cp{7.5cm}p{2.4cm}}

        \textbf{L4} & 
        For a sound explanation of both budget lines and indifference curves and a clear link to the separate demand curve, sound explanation of link between utility, price and demand, with accurate clear diagrams and a clear understanding of the principles involved. 
        &\\[-\normalbaselineskip]&
        &\textbf{[9--12]}\\
        \textbf{L4} & 
        For a sound explanation of both budget lines and indifference curves and a clear link to the separate demand curve, sound explanation of link between utility, price and demand, with accurate clear diagrams and a clear understanding of the principles involved. 
        &\\[-\normalbaselineskip]&
        &\textbf{[9--12]}\\
    \end{tabular}

\end{center}


\end{document}

enter image description here

This can be codified in macro form (though it is particular to a 3-column tabular. Here, \lastbit{} is the macro:

\documentclass[]{article}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{array}
\def\lastbit#1{\\[-\arraystretch\normalbaselineskip]&&\textbf{#1}}
\begin{document}
\pagenumbering{gobble}
\begin{center}

    \begin{tabular}{cp{7.5cm}p{2.4cm}}

        \textbf{L4} & 
        For a sound explanation of both budget lines and indifference curves and a clear link to the separate demand curve, sound explanation of link between utility, price and demand, with accurate clear diagrams and a clear understanding of the principles involved. 
        &\lastbit{[9--12]}\\
        \textbf{L4} & 
        For a sound explanation of both budget lines and indifference curves and a clear link to the separate demand curve, sound explanation of link between utility, price and demand, with accurate clear diagrams and a clear understanding of the principles involved. 
        &\lastbit{[9--12]}\\
    \end{tabular}

\end{center}
\end{document}
  • This is pretty genius - I wasn't aware of this baselineskip! Also - it does seem very weird to me that tabular cannot have columns independently aligned as desired. – Thevesh Theva Aug 27 '18 at 10:37
  • @TheveshTheva I had to use \normalbaselineskip, as \baselineskip is set to 0pt by the tabular environment. If you any \arraystretch active, there would require further modification. Alignment is a tricky thing, when you consider it has to account for letter descenders, etc. – Steven B. Segletes Aug 27 '18 at 10:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.