# Top alignment of cell content not working in tabular

I would like to align contents of cell to top. I used pos [t] option in tabular to do this. However, the contents are not getting top aligned despite my explicit mention. Any suggestion on this would be very helpful. Thank you.

\newcolumntype{Z}{>{\arraybackslash}m{11cm}}
\newcolumntype{Y}{>{\arraybackslash}m{1.8cm}}
\begin{table}[htbp]
\centering
\caption{Notations for MIP models}
\scalebox{0.9}{
\begin{tabular}[t]{YrZ}
\toprule
\textbf{Type} & \textbf{Notation} & \textbf{Definition} \\
\midrule
Set definitions & $\mathcal{S}$ & Collection of all node subsets $S \subset N$ such that $0 \in S$, $2n+1 \notin S$, and there exists a node $i \in P$ such that $i \notin S$ and $n+i \in S$\\[0.45cm]
&$\Omega$ & Collection of node subsets $S \subset P \cup D$ such that there is at least one customer order $j \in P$ such that either $j \in S$ and $n+j \notin S$ or $n+j \in S$ and $j \notin S$ \\[0.45cm]
&$A'$ & Subset of arcs having both endpoints in $P \cup D$\\[0.45cm]
&$\Upsilon_j$ & Collection of all node subsets $S \subset P \cup D$ such that $j \in S$ and $n+j \notin S$\\
\bottomrule
\end{tabular}
\label{tab:not1}
\end{table}


This is the output I get. As you can see, column 2 contents are not top aligned

• Welcome to TeX.SE. Change the column type from m ("m" is for "middle") to p.
– Mico
Mar 14, 2020 at 6:42
• avoid using \scalebox on tables, only use it as an absolute last resort (but even then try to avoid it). If you do use it, you want \scalebox{0.9}{% not \scalebox{0.9}{ as you are adding space to the left of the table. Mar 14, 2020 at 8:38
• Thank you for the valuable tip David. I will avoid scalebox for now. Mar 18, 2020 at 6:49

The t in \begin{tabular}[t]{YrZ} does stand for "top". However, it refers to the placement of the entire tabular environment with respect to other items in the same row, not to the placement of cell contents within the tabular environment itself. In the case of your code, the t placement specifier has no effect at all since there are no other items in the row that contains the tabular environment.

Your use of the m -- m stands for "middle" -- column type in the definitions of the Y and Z column types (employed in columns 1 and 3) forces LaTeX to center the other cells -- here, column 2 -- vertically.

What to do? Replace m with p in the definitions of Y and Z.

Your LaTeX code could stand some clean-up and simplification. For instance, your settings for the Y and Z columns apparently make the tabular environment wider than the text block; this, in turn, forces you to clean up the mess by placing the tabular in a \scalebox environment. Presumably, but not necessarily, the 0.9 scaling factor is good enough to force the tabular material back inside the text block. A cleaner setup would employ a tabularx environment (with overall width equal to \textwidth) and use that package's X column type for the third column; the width an X column is computed dynamically by LaTeX. A separate issue: the [0.45ex] extra spacing directive has no effect whatsoever in several cases. I suggest that since you employ the booktabs package, use that package's \addlinespace macro instead.

\documentclass{article}

\usepackage{tabularx,booktabs,ragged2e}
\newcolumntype{Y}{>{\RaggedRight\arraybackslash}p{1.6cm}} % 'p', not 'm'
\newcolumntype{L}{>{\RaggedRight\arraybackslash}X}

\usepackage[skip=0.333\baselineskip]{caption}

\begin{document}

\begin{table}[htbp]
\caption{Notation for MIP models}
\label{tab:not1}
\begin{tabularx}{\textwidth}{@{} YrL @{}}
\toprule
Type & Notation & Definition \\
\midrule
Set definitions
& $\mathcal{S}$
& Collection of all node subsets $S \subset N$ such that $0 \in S$, $2n+1 \notin S$, and there exists a node $i \in P$ such that $i \notin S$ and $n+i \in S$\\
&$\Omega$
& Collection of node subsets $S \subset P \cup D$ such that there is at least one customer order $j \in P$ such that either $j \in S$ and $n+j \notin S$ or $n+j \in S$ and $j \notin S$ \\
&$A'$ & Subset of arcs having both endpoints in $P \cup D$\\
&$\Upsilon_j$ & Collection of all node subsets $S \subset P \cup D$ such that $j \in S$ and $n+j \notin S$\\