I want to vertically center align texts in a cell of a table other columns of which contains itemize
lists. Stumbling upon this question, I tried to implement the accepted answer there. But that is not working when I add the second row. Following is an MWE:
\documentclass{article}
\usepackage{array}
\usepackage{enumitem}
\newcolumntype{M}[1]{%
>{\begin{minipage}{#1}}
m{#1}
<{\end{minipage}}
}
\begin{document}
\begin{table}[h!]
\setlist[itemize]{leftmargin=12pt}
\centering
\begin{tabular}{|m{0.05\linewidth}|M{0.25\linewidth}|M{0.25\linewidth}|M{0.25\linewidth}|}
\hline
& \multicolumn{1}{c|}{\textbf{Arts}} & \multicolumn{1}{c|}{\textbf{Science}} & \multicolumn{1}{c|}{\textbf{Commerce}}\\
\hline
UG &
\begin{itemize}[topsep=0pt, itemsep=0.5ex]
\item English
\item Education
\item Geography
\item History
\item Mass Communication \& Journalism
\item Political Science
\item Psychology
\item Sociology
\item Bachelor of Social Work
\item Physical Education (as general subject)
\end{itemize} &
\begin{itemize}[topsep=0pt, itemsep=0.5ex]
\item Computer Science
\item Economics
\item Mathematics
\item Physics
\item Statistics (as general subject)
\end{itemize} &
\begin{itemize}[topsep=0pt, itemsep=0.5ex]
\item B. Com. Honours
\item B. Com. General
\end{itemize}\\
\hline
PG &
\begin{itemize}[topsep=0pt, itemsep=0.5ex]
\item Education
\item English
\item Psychology
\end{itemize}
& &\\
\hline
\end{tabular}
\end{table}
\end{document}
I want vertically center alignment in the first column only. Rest of the columns should be top aligned. Please help me to achieve this.