0

I am normally typesetting small tables using the basic tabularenvironment. This has a optional parameter controlling the vertical position of the tabular with respect to the baseline of the surrounding text. Now for some reason I needed switch to tabularx. However, here the optional position parameter is missing, so that now the center of the table is aligned with the baseline:

\documentclass{standalone}
\usepackage{tabularx}

\begin{document}

A simple text
\begin{tabular}[b]{lr}
    A & B \\ C & D \\
\end{tabular}
and a little more
\begin{tabularx}{.1\linewidth}{lr}
    A & B \\ C & D \\
\end{tabularx}
and the rest.

\end{document}

enter image description here

Any idea how I can achieve an alignment with the bottom of the table?

  • 1
    note you have no X column in your tabularx so that can not work as a tabularx, it essentially falls back to being tabular* (but less efficient) every tabularx has to have at least one X column. – David Carlisle Dec 11 '16 at 14:42
  • @DavidCarlisle This is a MWE. I didnt need a X column here. Obviously, my use case is a bit more complex. – Dux Dec 11 '16 at 14:45
3

tabularx has the same parameter, as for tabular* it follows the width argument.

 \begin{tabularx}{3cm}[t]{XXX}

Early versions of the package documentation did not mention it but it has always had the argument.

  • Oh damn! I tried it, but before the length definition. And the package documentation on my system didn't mention it either. Thank you so much :D – Dux Dec 11 '16 at 14:44
  • @Dux No the doc didn't mention it explicitly for a couple of decades, I did update it last year (I think) however it was implicitly documented as the arguments of tabularx were defined as being "the same as tabular*" even in the earliest versions of the documentation. – David Carlisle Dec 11 '16 at 14:49
  • I sure missed that... – Dux Dec 11 '16 at 14:51

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.