2

I can't seem to find a previous answer that solves this problem: in the following table, I would like the text in the top-left cell to be vertically centered, not aligned at the top like it is now.

\documentclass[a4paper,12pt]{article}
\usepackage[margin=129pt]{geometry}
\usepackage{tabularx,graphics,makecell,mathptmx}

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

\begin{document}

\begin{table}[h]
\begin{tabularx}{\textwidth}{|c|X|c|c|}
\hline
\scriptsize \rotatebox{90}{\makecell{No. of\\the line.}} & \tiny\centering 
THE COLUMN WITH THE MOST TEXT. & \scriptsize\makecell{A header\\AND\\the 
description\\to go\\with it} & \scriptsize\makecell{Another header\\AND\\the 
description\\to go\\with it}\\ \hline
O & Some quite long text that will definitetly wrap over three lines& 
\makecell{100, 500 Values.\\36 No.} & 36, 24 No.\\  \hline

\end{tabularx}
\end{table}

\end{document}

enter image description here

Thank you for your help...

0

1 Answer 1

2

You can use a fixed-width first column of type m:

enter image description here

\documentclass{article}

\usepackage{tabularx,graphics,makecell}

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

\begin{document}

\noindent
\begin{tabularx}{\textwidth}{ | >{\centering} m{2em} | X | c | c | }
  \hline
  \scriptsize \rotatebox{90}{\makecell{No.\ of \\ the line.}} 
    & \tiny\centering THE COLUMN WITH THE MOST TEXT. 
    & \scriptsize\makecell{A header \\ AND \\ the description \\ to go \\ with it} 
    & \scriptsize\makecell{Another header \\ AND \\ the description \\ to go \\ with it} \\
  \hline
  O & Some quite long text that will definitely wrap over three lines
    & \makecell{100, 500 Values. \\ 36 No.} & 36, 24 No. \\
  \hline
\end{tabularx}

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .