4

I want LaTeX to place the text of some of the cells in my table (using tabularx) at the bottom of the cell. Right now all the text I write in the cells will be positioned at the top of each cell. Can I define it individually for each cell - the same goes for positioning the text of the cell in the middle of the row (but not centered in the column). I really hope my question is understandable.

lockstep
  • 250,273

1 Answers1

3

By default, X columns are translated to p{...} columns; if you want to change this, you can redefine \tabularxcolumn to use, for example, b{...} columns:

\documentclass{article}
\usepackage{tabularx}
\usepackage{lipsum}

\renewcommand\tabularxcolumn[1]{b{#1}}

\begin{document}

\noindent\begin{tabularx}{\linewidth}{XXX}
text & \lipsum*[2] & text
\end{tabularx}

\end{document}

enter image description here

Using the multirow package one can control alignment for individual cells:

\documentclass{article}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{lipsum}

\renewcommand\tabularxcolumn[1]{b{#1}}

\begin{document}

\noindent\begin{tabularx}{\linewidth}{XXX}
text & \lipsum*[2] & \multirow{-25}{*}{text}
\end{tabularx}

\end{document}

enter image description here

Gonzalo Medina
  • 505,128
  • Beautiful! But what if, let's say, I want the "text" in the 3rd column to be centered in the middle of the row (not the column), and still keep the "text" in 1st column at the bottom? – Niels Møller Sep 20 '12 at 20:10
  • @NielsMøller I updated my answer, but I am afraid that perhaps using another package might be better here (see Sveinung answer). – Gonzalo Medina Sep 20 '12 at 20:27