0

I know it is very similar to this question, this one, and others... but with 3 columns I have not been able to apply the solutions. I would like the two first columns (where I actually have a lot of text, of different length) to be top aligned, while the last column to be vertically centered.

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{tabularx}
\usepackage{lipsum}
\begin{document}

\noindent
\begin{tabularx}{\textwidth}{ | X | X | c | }
  \hline
  bla\newline bla \newline   & bla\newline bla \newline  & top\\
  \hline
  bla\newline bla \newline bla \newline  & \noindent\parbox[c]{\hsize}{ bla\newline bla \newline }  & center\\
  \hline
  bla\newline bla \newline & \noindent\parbox[b]{\hsize}{bla\newline bla \newline }   &  bottom\\
  \hline
\end{tabularx}

\end{document}

enter image description here

esperluette
  • 309
  • 5
  • 9

1 Answers1

0

You can do that with multirow by trial and error, counting the maximal number of lines in cells of the current row. I added the makecellpackage to have a simpler syntax with multirowcell:

\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage{tabularx}
\usepackage{makecell, multirow}
\usepackage{lipsum}
\begin{document}

\noindent
\begin{tabularx}{\textwidth}{ | X | X | c | }
  \hline
  bla\newline bla \newline & bla\newline bla \newline &\multirowcell{3}{top}\\
  \hline
  bla\newline bla \newline bla \newline & bla\newline bla \newline & \multirowcell{4}{center}\\
  \hline
  bla\newline bla \newline & bla\newline bla \newline & \multirowcell{3}{bottom}\\
  \hline
\end{tabularx}

\end{document} 

enter image description here

Bernard
  • 271,350
  • I see, I thought there would be something more 'automatic', like a new column definition. Seeing your number of points though, I think this is the best solution :) – esperluette Nov 28 '19 at 08:43
  • I don't know everything about LaTeX! If there is is an automatic solution, or if it is possible to define one, I don't know it. – Bernard Nov 28 '19 at 09:49