Code:
\documentclass{article}
\usepackage[a4paper]{geometry}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{array}
\begin{document}
\begin{tabular}{ |m{0.8cm}| p{3cm} |c| }
\hline
1
&
\begin{enumerate}
\setlength{\leftmargin}{0pt}
\item line 1
\item line 2
\end{enumerate}
&
2\\
\hline
\end{tabular}
\end{document}
Output:
My goal was to use c
environment for left and right columns and vertically center their content.
In this answer, @Werner says, that to center the content vertically, I must use m{<width>}
column type from array package. So, I tried it for the 1-st column. But with enumerate
it didn't work for some reason.
How can center columns 1 and 3 vertically? Ideally, keeping c
column type for automatic width, but even m
is ok, if it's impossible.