0
\begin{center}
    \begin{longtable}{|>{\centering}m{.2\textwidth}|m{.2\textwidth}|}
    \hline
    \makecell[{{p{.2\textwidth}}}]{this is a test test test test test test\\ a test too} & bear \\\hline
    \end{longtable}
\end{center}

enter image description here The first column is left aligned, but I want to center-align the column. What can I do this?

1 Answers1

2

I don't know if this is what is needed:

\documentclass[]{article}
\usepackage{longtable,makecell}
\begin{document}
\begin{center}
with makecell
    \begin{longtable}{|c|m{.2\textwidth}|}
    \hline
    \makecell[cm{0.2\textwidth}]{\centering this is a test test test test test test
    \\ a test too} & bear \\\hline
    \end{longtable}
\end{center}

\begin{center}
without makecell
    \begin{longtable}{|>{\centering}m{0.2\textwidth}|m{.2\textwidth}|}
    \hline
  this is a test test test test test test
    \\ a test too & bear \\\hline
    \end{longtable}
\end{center}
\end{document}

The second suggestion is based on @leandriis comment

enter image description here